diff options
author | misuzu <bakalolka@gmail.com> | 2024-06-12 20:06:38 +0300 |
---|---|---|
committer | misuzu <bakalolka@gmail.com> | 2024-06-12 21:21:50 +0300 |
commit | 4df3c4c17b3622c2f3f2dc8bb877ac8470efc1c6 (patch) | |
tree | 56df45c25bb03daafdc0f82d742fe023dbf7d292 /nixos/modules | |
parent | c7b821ba2e1e635ba5a76d299af62821cbcb09f3 (diff) |
nixos/clevis: add support for parent encrypted zfs datasets
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/system/boot/clevis.nix | 2 | ||||
-rw-r--r-- | nixos/modules/tasks/filesystems/zfs.nix | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/nixos/modules/system/boot/clevis.nix b/nixos/modules/system/boot/clevis.nix index d9390f5bc15f8..ac881e9535767 100644 --- a/nixos/modules/system/boot/clevis.nix +++ b/nixos/modules/system/boot/clevis.nix @@ -48,7 +48,7 @@ in assertions = (attrValues (mapAttrs (device: _: { - assertion = (any (fs: fs.device == device && (elem fs.fsType supportedFs)) config.system.build.fileSystems) || (hasAttr device config.boot.initrd.luks.devices); + assertion = (any (fs: fs.device == device && (elem fs.fsType supportedFs) || (fs.fsType == "zfs" && hasPrefix "${device}/" fs.device)) config.system.build.fileSystems) || (hasAttr device config.boot.initrd.luks.devices); message = '' No filesystem or LUKS device with the name ${device} is declared in your configuration.''; }) diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix index b75817a011cbd..7861a4b946b4b 100644 --- a/nixos/modules/tasks/filesystems/zfs.nix +++ b/nixos/modules/tasks/filesystems/zfs.nix @@ -17,8 +17,7 @@ let cfgZED = config.services.zfs.zed; selectModulePackage = package: config.boot.kernelPackages.${package.kernelModuleAttribute}; - clevisDatasets = map (e: e.device) (filter (e: e.device != null && (hasAttr e.device config.boot.initrd.clevis.devices) && e.fsType == "zfs" && (fsNeededForBoot e)) config.system.build.fileSystems); - + clevisDatasets = attrNames (filterAttrs (device: _: any (e: e.fsType == "zfs" && (fsNeededForBoot e) && (e.device == device || hasPrefix "${device}/" e.device)) config.system.build.fileSystems) config.boot.initrd.clevis.devices); inInitrd = config.boot.initrd.supportedFilesystems.zfs or false; inSystem = config.boot.supportedFilesystems.zfs or false; |