diff options
author | Karel Kočí <cynerd@email.cz> | 2022-01-02 17:23:58 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2022-04-12 21:48:06 +0200 |
commit | 5339e045194c5ad482250c0271959a5fd9f97db2 (patch) | |
tree | 44d068a2c15b4683f0eb124044bf8c59bda398d1 /medkit.nix | |
parent | 00e3489cc7ea1edc3e71aaa94a62efbd13d65e49 (diff) | |
download | nixturris-5339e045194c5ad482250c0271959a5fd9f97db2.tar.gz nixturris-5339e045194c5ad482250c0271959a5fd9f97db2.tar.bz2 nixturris-5339e045194c5ad482250c0271959a5fd9f97db2.zip |
nios: Add sentinel module
Diffstat (limited to 'medkit.nix')
-rw-r--r-- | medkit.nix | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/medkit.nix b/medkit.nix new file mode 100644 index 0000000..aa93080 --- /dev/null +++ b/medkit.nix @@ -0,0 +1,45 @@ +board: { config, lib, pkgs, modulesPath, ... }: { + imports = [ + "${toString modulesPath}/installer/cd-dvd/system-tarball.nix" + ]; + + boot.consoleLogLevel = lib.mkDefault 7; + turris.device = "/dev/mmcblk1"; # TODO this is for mox and sd card only + + # Allow access to the root account right after installation + users = { + mutableUsers = false; + users.root.password = "nixturris"; + }; + + # TODO we have to generate the hardware specific configuration on first boot + tarball.contents = [ + { source = pkgs.writeText "default-nixturris-flake" '' + { + inputs.nixturris.url = "git+git://cynerd.cz/nixturris.git"; + outputs = { self, nixturris }: { + nixosConfigurations.nixturris = nixturris.lib.nixturrisSystem { + board = "${board}"; + modules = [({ config, lib, pkgs, ... }: { + # Optionally place your configuration here + })]; + }; + }; + } + ''; + target = "/etc/nixos/flake.nix"; + } + { source = pkgs.writeText "medkit-extlinux" '' + DEFAULT nixos-default + TIMEOUT 0 + LABEL nixos-default + MENU LABEL NixOS - Default + FDTDIR /run/current-system/dtbs + LINUX /run/current-system/kernel + INITRD /run/current-system/initrd + APPEND init=${config.system.build.toplevel}/init ${builtins.toString config.boot.kernelParams} + ''; + target = "/boot/extlinux/extlinux.conf"; + } + ]; +} |