mirror of
https://github.com/nix-community/disko
synced 2024-11-10 06:14:14 +00:00
swap: add mountOptions
This commit is contained in:
parent
85538a44de
commit
39b4091769
1 changed files with 10 additions and 1 deletions
|
@ -28,6 +28,12 @@
|
||||||
default = [ ];
|
default = [ ];
|
||||||
description = "Extra arguments";
|
description = "Extra arguments";
|
||||||
};
|
};
|
||||||
|
mountOptions = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.nonEmptyStr;
|
||||||
|
default = [ "defaults" ];
|
||||||
|
example = [ "nofail" ];
|
||||||
|
description = "Options used to mount the swap.";
|
||||||
|
};
|
||||||
priority = lib.mkOption {
|
priority = lib.mkOption {
|
||||||
type = lib.types.nullOr lib.types.int;
|
type = lib.types.nullOr lib.types.int;
|
||||||
default = null;
|
default = null;
|
||||||
|
@ -82,7 +88,9 @@
|
||||||
}"} ${
|
}"} ${
|
||||||
lib.optionalString (config.priority != null)
|
lib.optionalString (config.priority != null)
|
||||||
"--priority=${toString config.priority}"
|
"--priority=${toString config.priority}"
|
||||||
} ${config.device}
|
} \
|
||||||
|
--options=${lib.concatStringsSep "," config.mountOptions} \
|
||||||
|
${config.device}
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
@ -99,6 +107,7 @@
|
||||||
# forward discard/TRIM attempts through dm-crypt
|
# forward discard/TRIM attempts through dm-crypt
|
||||||
allowDiscards = config.discardPolicy != null;
|
allowDiscards = config.discardPolicy != null;
|
||||||
};
|
};
|
||||||
|
options = config.mountOptions;
|
||||||
}];
|
}];
|
||||||
boot.resumeDevice = lib.mkIf config.resumeDevice config.device;
|
boot.resumeDevice = lib.mkIf config.resumeDevice config.device;
|
||||||
}];
|
}];
|
||||||
|
|
Loading…
Reference in a new issue