Allow specifying mount options

This commit is contained in:
Manuel Thalmann 2024-06-22 20:52:46 +02:00
parent fbf57d3f9d
commit af4da23427

View file

@ -221,6 +221,12 @@
description = "The mountpoint of the partition."; description = "The mountpoint of the partition.";
default = null; default = null;
}; };
mountOptions = mkOption {
type = types.listOf types.str;
description = "The options to apply to the mount.";
default = [];
};
}; };
config = { config = {
@ -278,6 +284,7 @@
(_: builtins.concatStringsSep " " [ (_: builtins.concatStringsSep " " [
"mount" "mount"
"--mkdir" "--mkdir"
(builtins.concatStringsSep " " (builtins.map (_: "-o ${_}") _.mountOptions))
(partPath _) (partPath _)
(normalizePath "/${rootDir}/${_.mountPoint}") (normalizePath "/${rootDir}/${_.mountPoint}")
]) ])