nixos/swap: add options option
This commit is contained in:
parent
a3c5f0cba8
commit
c971de97c4
2 changed files with 10 additions and 1 deletions
|
@ -127,6 +127,15 @@ let
|
|||
'';
|
||||
};
|
||||
|
||||
options = mkOption {
|
||||
default = [ "defaults" ];
|
||||
example = [ "nofail" ];
|
||||
type = types.listOf types.nonEmptyStr;
|
||||
description = ''
|
||||
Options used to mount the swap.
|
||||
'';
|
||||
};
|
||||
|
||||
deviceName = mkOption {
|
||||
type = types.str;
|
||||
internal = true;
|
||||
|
|
|
@ -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}"}"
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue