diff --git a/nixos/modules/config/swap.nix b/nixos/modules/config/swap.nix index 7d4654ae287..fb171050d3e 100644 --- a/nixos/modules/config/swap.nix +++ b/nixos/modules/config/swap.nix @@ -72,11 +72,8 @@ with utils; }; config = { - device = - if options.label.isDefined then - "/dev/disk/by-label/${config.label}" - else - mkNotdef; + device = mkIf options.label.isDefined + "/dev/disk/by-label/${config.label}"; }; };