nixos/swap: refactor, add randomEncryption option

This commit is contained in:
Nikolay Amiantov
2015-10-20 15:56:12 +03:00
parent 5c56b7e526
commit de8b8b35a4
3 changed files with 104 additions and 67 deletions
+1 -1
View File
@@ -206,7 +206,7 @@ let
preLVMCommands postDeviceCommands postMountCommands kernelModules;
resumeDevices = map (sd: if sd ? device then sd.device else "/dev/disk/by-label/${sd.label}")
(filter (sd: sd ? label || hasPrefix "/dev/" sd.device) config.swapDevices);
(filter (sd: (sd ? label || hasPrefix "/dev/" sd.device) && !sd.randomEncryption) config.swapDevices);
fsInfo =
let f = fs: [ fs.mountPoint (if fs.device != null then fs.device else "/dev/disk/by-label/${fs.label}") fs.fsType fs.options ];