summaryrefslogtreecommitdiffstats
path: root/nixos/modules/tasks/filesystems.nix
diff options
context:
space:
mode:
authorArtturin <Artturin@artturin.com>2021-06-24 20:58:18 +0300
committerArtturin <Artturin@artturin.com>2021-07-20 20:51:27 +0300
commitc971de97c4146a052b731fd47babc8be395ffdf0 (patch)
treed8d2787dbc73a4dc74e5137ee5a04608e8d6a964 /nixos/modules/tasks/filesystems.nix
parenta3c5f0cba8fa9c4d9782ef83757be6e4028f54b7 (diff)
nixos/swap: add options option
Diffstat (limited to 'nixos/modules/tasks/filesystems.nix')
-rw-r--r--nixos/modules/tasks/filesystems.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/tasks/filesystems.nix b/nixos/modules/tasks/filesystems.nix
index d274a38a270f..2f17608560f7 100644
--- a/nixos/modules/tasks/filesystems.nix
+++ b/nixos/modules/tasks/filesystems.nix
@@ -255,7 +255,7 @@ in
# https://wiki.archlinux.org/index.php/fstab#Filepath_spaces
escape = string: builtins.replaceStrings [ " " "\t" ] [ "\\040" "\\011" ] string;
swapOptions = sw: concatStringsSep "," (
- [ "defaults" ]
+ sw.options
++ optional (sw.priority != null) "pri=${toString sw.priority}"
++ optional (sw.discardPolicy != null) "discard${optionalString (sw.discardPolicy != "both") "=${toString sw.discardPolicy}"}"
);