summary refs log tree commit diff
path: root/nixos/modules/system/boot/stage-1.nix
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2016-09-24 13:06:27 +0300
committerNikolay Amiantov <ab@fmap.me>2016-09-24 13:06:27 +0300
commita63ca1bf3de482e6cb0cf0e3ce55ececc608b04b (patch)
tree43d8fdc30757cf44d445ad96b032cc304fbb6e60 /nixos/modules/system/boot/stage-1.nix
parente80b22369dd029cfd4ad9891f245daccba8d1158 (diff)
downloadnixpkgs-a63ca1bf3de482e6cb0cf0e3ce55ececc608b04b.tar
nixpkgs-a63ca1bf3de482e6cb0cf0e3ce55ececc608b04b.tar.gz
nixpkgs-a63ca1bf3de482e6cb0cf0e3ce55ececc608b04b.tar.bz2
nixpkgs-a63ca1bf3de482e6cb0cf0e3ce55ececc608b04b.tar.lz
nixpkgs-a63ca1bf3de482e6cb0cf0e3ce55ececc608b04b.tar.xz
nixpkgs-a63ca1bf3de482e6cb0cf0e3ce55ececc608b04b.tar.zst
nixpkgs-a63ca1bf3de482e6cb0cf0e3ce55ececc608b04b.zip
stage-1 module: remove check that swap device has a label
All swap device option sets "have" a label, it's just that sometimes it's
undefined. Because we set a `device` attribute when we have a label anyway it's
ok to just check device prefix.

Fixes #18891.
Diffstat (limited to 'nixos/modules/system/boot/stage-1.nix')
-rw-r--r--nixos/modules/system/boot/stage-1.nix7
1 files changed, 4 insertions, 3 deletions
diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix
index 513c121347b..40e67fa5f8d 100644
--- a/nixos/modules/system/boot/stage-1.nix
+++ b/nixos/modules/system/boot/stage-1.nix
@@ -198,9 +198,10 @@ let
       preLVMCommands preDeviceCommands postDeviceCommands postMountCommands preFailCommands 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) && !sd.randomEncryption 
-                    # Don't include zram devices
-                    && !(hasPrefix "/dev/zram" sd.device)) config.swapDevices);
+                    (filter (sd: hasPrefix "/dev/" sd.device && !sd.randomEncryption
+                             # Don't include zram devices
+                             && !(hasPrefix "/dev/zram" sd.device)
+                            ) config.swapDevices);
 
     fsInfo =
       let f = fs: [ fs.mountPoint (if fs.device != null then fs.device else "/dev/disk/by-label/${fs.label}") fs.fsType (builtins.concatStringsSep "," fs.options) ];