diff options
author | aszlig <aszlig@nix.build> | 2020-09-14 23:41:28 +0200 |
---|---|---|
committer | aszlig <aszlig@nix.build> | 2020-09-14 23:51:16 +0200 |
commit | f6561ac1edae7e795f1edaa96c73f4b34f0e9b04 (patch) | |
tree | dce1b7b85df75bd785e9f36d6a9f7ad0cc0c9f57 | |
parent | 6b872d71f22ec01d146935c28f37c49722a23255 (diff) |
Use attribute sets for boot.initrd.luks.devices
This was one of the places where types.loaOf was still in place and it got removed a while[1] ago and this in turn causes evaluation to fail for quite a few machines: The option value `boot.initrd.luks.devices' in `...' is not of type `attribute set of submodules'. I've not only changed all the machines to use attribute sets but also fixed the check in core/tests.nix, because comparing against a list when the actual type is an attribute set will result in all the LUKS tests to be part of *all* channels, no matter whether you're actually using LUKS. [1]: https://github.com/NixOS/nixpkgs/commit/20d491a317d9956ddca80913f07 Signed-off-by: aszlig <aszlig@nix.build> Cc: @Profpatsch Cc: @sternenseemann
-rw-r--r-- | machines/aszlig/managed/shakti.nix | 17 | ||||
-rw-r--r-- | machines/aszlig/managed/tyree.nix | 16 | ||||
-rw-r--r-- | machines/aszlig/tishtushi.nix | 16 | ||||
-rw-r--r-- | machines/profpatsch/mikiya.nix | 7 | ||||
-rw-r--r-- | machines/sternenseemann/fliewatuet.nix | 2 | ||||
-rw-r--r-- | machines/sternenseemann/schnurrkadse.nix | 8 | ||||
-rw-r--r-- | modules/core/tests.nix | 2 |
7 files changed, 33 insertions, 35 deletions
diff --git a/machines/aszlig/managed/shakti.nix b/machines/aszlig/managed/shakti.nix index 8440ce6f..e916914c 100644 --- a/machines/aszlig/managed/shakti.nix +++ b/machines/aszlig/managed/shakti.nix @@ -3,19 +3,20 @@ { boot.loader.efi.canTouchEfiVariables = true; - boot.initrd.luks.devices = [ - { name = "00vault"; + boot.initrd.luks.devices = { + "00vault" = { device = "/dev/disk/by-uuid/a70f4ff8-e463-42fa-8148-6783dd352f96"; - } - { name = "shakti-swap"; + }; + shakti-swap = { device = "/dev/disk/by-uuid/69f3a774-c796-4dbd-a38b-32f019d05e7c"; keyFile = "/dev/mapper/00vault"; - } - { name = "shakti-root"; + }; + shakti-root = { device = "/dev/disk/by-uuid/8a67bdf9-08bb-4214-b728-88cf1c2ee206"; keyFile = "/dev/mapper/00vault"; - } - ]; + }; + }; + boot.initrd.postDeviceCommands = lib.mkAfter '' cryptsetup luksClose /dev/mapper/00vault ''; diff --git a/machines/aszlig/managed/tyree.nix b/machines/aszlig/managed/tyree.nix index 2f2c410d..c7190507 100644 --- a/machines/aszlig/managed/tyree.nix +++ b/machines/aszlig/managed/tyree.nix @@ -4,19 +4,19 @@ boot.initrd.availableKernelModules = [ "usbhid" ]; boot.kernelModules = [ "kvm-intel" ]; - boot.initrd.luks.devices = [ - { name = "00-vault"; + boot.initrd.luks.devices = { + "00-vault" = { device = "/dev/disk/by-uuid/e4eb3d30-7fa5-4af4-86fb-80b47518cc25"; - } - { name = "tyree-swap"; + }; + tyree-swap = { device = "/dev/disk/by-uuid/d96e29b4-0b9a-442d-af27-805f69ffffb3"; keyFile = "/dev/mapper/00-vault"; - } - { name = "tyree-root"; + }; + tyree-root = { device = "/dev/disk/by-uuid/21e9a86e-c8dc-4d8f-ba75-d03552dc32f7"; keyFile = "/dev/mapper/00-vault"; - } - ]; + }; + }; boot.initrd.postDeviceCommands = lib.mkAfter '' cryptsetup luksClose /dev/mapper/00-vault diff --git a/machines/aszlig/tishtushi.nix b/machines/aszlig/tishtushi.nix index f38f894a..e8c22291 100644 --- a/machines/aszlig/tishtushi.nix +++ b/machines/aszlig/tishtushi.nix @@ -13,19 +13,19 @@ }; boot.initrd = { - luks.devices = [ - { name = "00vault"; + luks.devices = { + "00vault" = { device = "/dev/disk/by-uuid/812f19f1-9096-4367-b2e4-0c9537c52a67"; - } - { name = "tishtushi-swap"; + }; + tishtushi-swap = { device = "/dev/disk/by-uuid/2934df87-5fda-4b2e-9f3b-c4c96f571407"; keyFile = "/dev/mapper/00vault"; - } - { name = "tishtushi-root"; + }; + tishtushi-root = { device = "/dev/disk/by-uuid/cf65f144-9205-40a5-a239-b660695a6740"; keyFile = "/dev/mapper/00vault"; - } - ]; + }; + }; postDeviceCommands = lib.mkAfter '' cryptsetup luksClose /dev/mapper/00vault ''; diff --git a/machines/profpatsch/mikiya.nix b/machines/profpatsch/mikiya.nix index db3b6865..74acc76b 100644 --- a/machines/profpatsch/mikiya.nix +++ b/machines/profpatsch/mikiya.nix @@ -11,10 +11,7 @@ let }; systemDevice = "/dev/disk/by-id/ata-MKNSSDCR60GB-DX_MKN1140A0000025162"; - systemPartition = { - name = "mikiya-root"; - device = "/dev/disk/by-uuid/56910867-ed83-438a-b67c-c057e662c89e"; - }; + systemPartition = "/dev/disk/by-uuid/56910867-ed83-438a-b67c-c057e662c89e"; rootDevice = "/dev/mapper/mikiya-root"; raidDevices = lib.imap (mkDevice "raid") [ @@ -51,7 +48,7 @@ in { ]; # decrypt root device - luks.devices = [systemPartition]; + luks.devices.mikiya-root.device = systemPartition; }; }; diff --git a/machines/sternenseemann/fliewatuet.nix b/machines/sternenseemann/fliewatuet.nix index a621270a..9daa9ea1 100644 --- a/machines/sternenseemann/fliewatuet.nix +++ b/machines/sternenseemann/fliewatuet.nix @@ -10,7 +10,7 @@ in { boot.blacklistedKernelModules = [ "nouveau" "nvidia" ]; boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" ]; boot.kernelModules = [ "kvm-intel" ]; - boot.initrd.luks.devices = [ { device = "/dev/sda2"; name = "crypted"; } ]; + boot.initrd.luks.devices.crypted.device = "/dev/sda2"; fileSystems."/" = { device = "/dev/dm-0"; diff --git a/machines/sternenseemann/schnurrkadse.nix b/machines/sternenseemann/schnurrkadse.nix index fc189956..383807ba 100644 --- a/machines/sternenseemann/schnurrkadse.nix +++ b/machines/sternenseemann/schnurrkadse.nix @@ -11,10 +11,10 @@ in { boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; - boot.initrd.luks.devices = - [ { name = "schnurrkadse"; - device = "/dev/disk/by-uuid/544529b8-81cb-4e8e-9b6b-44f828ea2a7b"; - preLVM = true; } ]; + boot.initrd.luks.devices.schnurrkadse = { + device = "/dev/disk/by-uuid/544529b8-81cb-4e8e-9b6b-44f828ea2a7b"; + preLVM = true; + }; fileSystems."/" = { device = "/dev/mapper/schnurrkadse-root"; diff --git a/modules/core/tests.nix b/modules/core/tests.nix index 6ca1e255..0d581aec 100644 --- a/modules/core/tests.nix +++ b/modules/core/tests.nix @@ -383,7 +383,7 @@ let { check = config.boot.loader.grub.version == 1; path = ["nixos" "installer" "grub1"]; } - { check = config.boot.initrd.luks.devices != []; + { check = config.boot.initrd.luks.devices != {}; paths = [ ["nixos" "installer" "luksroot"] ["nixos" "installer" "luksroot-format1"] |