git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #29426 from Mic92/zfsUnstable

nixos/zfs: import encrypted datasets by default for zfsUnstable

commitc74418a4e67ba242fc416b699ec8825291aa6889 authorJörg Thalheim <Mic92@users.noreply.github.com> dateTue 26 Sep 2017, 09:10 (9 years ago) parentb303aa08fcf95f
3 files changed+24−6
nixos/modules/tasks/filesystems/zfs.nix+18 pkgs/os-specific/linux/spl/default.nix+3−3 pkgs/os-specific/linux/zfs/default.nix+3−3
nixos/modules/tasks/filesystems/zfs.nix+18
@@ -140,6 +140,17 @@ in
140140 this once.
141141 '';
142142 };
143+
144+ requestEncryptionCredentials = mkOption {
145+ type = types.bool;
146+ default = config.boot.zfs.enableUnstable;
147+ description = ''
148+ Request encryption keys or passwords for all encrypted datasets on import.
149+
150+ Dataset encryption is only supported in zfsUnstable at the moment.
151+ '';
152+ };
153+
143154 };
144155
145156 services.zfs.autoSnapshot = {
@@ -263,6 +274,10 @@ in
263274 assertion = !cfgZfs.forceImportAll || cfgZfs.forceImportRoot;
264275 message = "If you enable boot.zfs.forceImportAll, you must also enable boot.zfs.forceImportRoot";
265276 }
277+ {
278+ assertion = cfgZfs.requestEncryptionCredentials -> cfgZfs.enableUnstable;
279+ message = "This feature is only available for zfs unstable. Set the NixOS option boot.zfs.enableUnstable.";
280+ }
266281 ];
267282
268283 boot = {
@@ -306,6 +321,9 @@ in
306321 done
307322 echo
308323 if [[ -n "$msg" ]]; then echo "$msg"; fi
324+ ${lib.optionalString cfgZfs.requestEncryptionCredentials ''
325+ zfs load-key -a
326+ ''}
309327 '') rootPools));
310328 };
311329
pkgs/os-specific/linux/spl/default.nix+3−3
@@ -68,8 +68,8 @@ in
6868 };
6969
7070 splUnstable = common {
71− version = "2017-08-11";
72− rev = "9df9692637aeee416f509c7f39655beb2d35b549";
73− sha256 = "1dggf6xqgk2f7vccv6cgvr8krj7h9f921szp1j2qbxnnq41m37mi";
71+ version = "2017-09-26";
72+ rev = "e8474f9ad3b3d23c3277535c4f53f8fd1e6cbd74";
73+ sha256 = "1hydfhmngpq31gxkxipqxnin74l760d1ia202h12vsgix9sp32h7";
7474 };
7575}
pkgs/os-specific/linux/zfs/default.nix+3−3
@@ -157,10 +157,10 @@ in {
157157 incompatibleKernelVersion = null;
158158
159159 # this package should point to a version / git revision compatible with the latest kernel release
160− version = "2017-09-12";
160+ version = "2017-09-26";
161161
162− rev = "ded8f06a3cfee60b3a8ea5309e9c4d0e567ed3b5";
163− sha256 = "0yn4fg4a00hpflmmr0jbbhfb921nygpw2xbbjy35abl57k6zk375";
162+ rev = "7e98073379353a05498ac5a2f1a5df2a2257d6b0";
163+ sha256 = "1hydfhmngpq31gxkxipqxnin74l760d1ia202h12vsgix9sp32h7";
164164 isUnstable = true;
165165
166166 extraPatches = [