Merge pull request #280296 from ancathri/getKeyLocations-nosnapshots

nixos/zfs: fix getKeyLocations when listsnaps=on
This commit is contained in:
Will Fancher 2024-01-15 11:31:25 -05:00 committed by GitHub
commit c6f2b53e78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 ? "" }: