···
specialFSTypes = [ "proc" "sysfs" "tmpfs" "devtmpfs" "devpts" ];
23
-
fileSystemOpts = { name, config, ... }: {
23
+
coreFileSystemOpts = { name, config, ... }: {
···
description = "Location of the device.";
42
-
example = "root-partition";
43
-
type = types.nullOr types.str;
44
-
description = "Label of the device (if any).";
···
apply = x: if isList x then x else lib.strings.splitString "," (builtins.trace "warning: passing a comma-separated string for filesystem options is deprecated; use a list of strings instead. This will become a hard error in 16.09." x);
61
+
mountPoint = mkDefault name;
62
+
device = mkIf (elem config.fsType specialFSTypes) (mkDefault config.fsType);
67
+
fileSystemOpts = { config, ... }: {
73
+
example = "root-partition";
74
+
type = types.nullOr types.str;
75
+
description = "Label of the device (if any).";
···
description = "Disable running fsck on this filesystem.";
107
-
Mount this filesystem very early during boot. At the moment of
108
-
mounting no disks are exposed, so this option is primarily for
109
-
special file systems.
116
-
mountPoint = mkDefault name;
117
-
device = mkIf (elem config.fsType specialFSTypes) (mkDefault config.fsType);
options = mkIf config.autoResize [ "x-nixos.autoresize" ];
# -F needed to allow bare block device without partitions
···
"/bigdisk".label = "bigdisk";
154
-
type = types.loaOf (types.submodule fileSystemOpts);
154
+
type = types.loaOf (types.submodule [coreFileSystemOpts fileSystemOpts]);
The file systems to be mounted. It must include an entry for
the root directory (<literal>mountPoint = "/"</literal>). Each
···
description = "Names of supported filesystem types.";
186
+
boot.specialFileSystems = mkOption {
188
+
type = types.loaOf (types.submodule coreFileSystemOpts);
191
+
Special filesystems that are mounted very early during boot.
···
{ assertion = ! (fileSystems' ? "cycle");
message = "The ‘fileSystems’ option can't be topologically sorted: mountpoint dependency path ${ls " -> " fileSystems'.cycle} loops to ${ls ", " fileSystems'.loops}";
199
-
{ assertion = all (x: !x.early || (x.label == null && !x.autoFormat && !x.autoResize)) fileSystems;
200
-
message = "Early filesystems don't support mounting by label, auto formatting and resizing";
# Export for use in other modules
system.build.fileSystems = fileSystems;
206
-
system.build.earlyMountScript = makeSpecialMounts (filter (fs: fs.early) fileSystems);
212
+
system.build.earlyMountScript = makeSpecialMounts (toposort fsBefore (attrValues config.boot.specialFileSystems)).result;
boot.supportedFilesystems = map (fs: fs.fsType) fileSystems;
···
+ " " + (if skipCheck fs then "0" else
if fs.mountPoint == "/" then "1" else "2")
237
-
) (filter (fs: !fs.early) fileSystems)}
${flip concatMapStrings config.swapDevices (sw:
···
in listToAttrs (map formatDevice (filter (fs: fs.autoFormat) fileSystems));
# Sync mount options with systemd's src/core/mount-setup.c: mount_table.
285
-
fileSystems = mapAttrs (n: fs: fs // { early = true; }) {
291
+
boot.specialFileSystems = {
"/proc" = { fsType = "proc"; options = [ "nosuid" "noexec" "nodev" ]; };
"/sys" = { fsType = "sysfs"; options = [ "nosuid" "noexec" "nodev" ]; };
"/run" = { fsType = "tmpfs"; options = [ "nosuid" "nodev" "strictatime" "mode=755" "size=${config.boot.runSize}" ]; };