diff --git a/nixos/modules/tasks/filesystems.nix b/nixos/modules/tasks/filesystems.nix index f98ef33046352..9afb2e45334f0 100644 --- a/nixos/modules/tasks/filesystems.nix +++ b/nixos/modules/tasks/filesystems.nix @@ -400,7 +400,7 @@ in # Filesystems. ${makeFstabEntries fileSystems {}} - # Swap devices. + ${lib.optionalString (config.swapDevices != []) "# Swap devices."} ${flip concatMapStrings config.swapDevices (sw: "${sw.realDevice} none swap ${swapOptions sw}\n" )}