about summary refs log tree commit diff
diff options
context:
space:
mode:
authorancathri <sam@etzkin.org>2024-01-11 08:56:36 -0600
committerSam Etzkin <sam@etzkin.org>2024-01-12 19:06:00 -0600
commit51dfaf639a9365f327e1ffd153a237178999fb82 (patch)
treeee12ecde46fbfa809ce6c7f589d8a4821db2d116
parent24a99633377da1860477dc1970c6a8ca0b364b70 (diff)
downloadnixlib-51dfaf639a9365f327e1ffd153a237178999fb82.tar
nixlib-51dfaf639a9365f327e1ffd153a237178999fb82.tar.gz
nixlib-51dfaf639a9365f327e1ffd153a237178999fb82.tar.bz2
nixlib-51dfaf639a9365f327e1ffd153a237178999fb82.tar.lz
nixlib-51dfaf639a9365f327e1ffd153a237178999fb82.tar.xz
nixlib-51dfaf639a9365f327e1ffd153a237178999fb82.tar.zst
nixlib-51dfaf639a9365f327e1ffd153a237178999fb82.zip
nixos/zfs: fix getKeyLocations when listsnaps=on
Encountered boot errors in pool with `listsnapshots=on` getKeyLocations should ignore snapshots as they will not be well-handled by createImportService later on
-rw-r--r--nixos/modules/tasks/filesystems/zfs.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix
index b38f228fc160..a4e712854c0b 100644
--- a/nixos/modules/tasks/filesystems/zfs.nix
+++ b/nixos/modules/tasks/filesystems/zfs.nix
@@ -108,12 +108,12 @@ let
 
   getKeyLocations = pool: if isBool cfgZfs.requestEncryptionCredentials then {
     hasKeys = cfgZfs.requestEncryptionCredentials;
-    command = "${cfgZfs.package}/sbin/zfs list -rHo name,keylocation,keystatus ${pool}";
+    command = "${cfgZfs.package}/sbin/zfs list -rHo name,keylocation,keystatus -t volume,filesystem ${pool}";
   } else let
     keys = filter (x: datasetToPool x == pool) cfgZfs.requestEncryptionCredentials;
   in {
     hasKeys = keys != [];
-    command = "${cfgZfs.package}/sbin/zfs list -Ho name,keylocation,keystatus ${toString keys}";
+    command = "${cfgZfs.package}/sbin/zfs list -Ho name,keylocation,keystatus -t volume,filesystem ${toString keys}";
   };
 
   createImportService = { pool, systemd, force, prefix ? "" }: