Skip to content

fileSystems

virtualisation.fileSystems.<name>.autoFormat

If the device does not currently contain a filesystem (as determined by {command}blkid), then automatically format it with the filesystem type specified in {option}fsType. Use with caution.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems.nix

virtualisation.fileSystems.<name>.autoResize

If set, the filesystem is grown to its maximum size before being mounted. (This is typically the size of the containing partition.) This is currently only supported for ext2/3/4 filesystems that are mounted during early boot.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems.nix

virtualisation.fileSystems.<name>.depends

List of paths that should be mounted before this one. This filesystem's {option}device and {option}mountPoint are always checked and do not need to be included explicitly. If a path is added to this list, any other filesystem whose mount point is a parent of the path will be mounted before this filesystem. The paths do not need to actually be the {option}mountPoint of some other filesystem.

Type: list of string (with check: non-empty without trailing slash)

Default

[ ]

Example

["/persist"]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems.nix

virtualisation.fileSystems.<name>.device

Location of the device. Type: null or string (with check: non-empty)

Default

null

Example

"/dev/sda"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems.nix

virtualisation.fileSystems.<name>.encrypted.blkDev

Location of the backing encrypted device. Type: null or string

Default

null

Example

"/dev/sda1"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/encrypted-devices.nix

virtualisation.fileSystems.<name>.encrypted.enable

The block device is backed by an encrypted one, adds this device as a initrd luks entry. Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/encrypted-devices.nix

virtualisation.fileSystems.<name>.encrypted.keyFile

Path to a keyfile used to unlock the backing encrypted device. When systemd stage 1 is not enabled, at the time this keyfile is accessed, the neededForBoot filesystems (see utils.fsNeededForBoot) will have been mounted under /mnt-root, so the keyfile path should usually start with "/mnt-root/". When systemd stage 1 is enabled, fsNeededForBoot file systems will be mounted as needed under /sysroot, and the keyfile will not be accessed until its requisite mounts are done.

Type: null or string

Default

null

Example

"/mnt-root/root/.swapkey"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/encrypted-devices.nix

virtualisation.fileSystems.<name>.encrypted.label

Label of the unlocked encrypted device. Set fileSystems.<name?>.device to /dev/mapper/<label> to mount the unlocked device. Type: null or string

Default

null

Example

"rootfs"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/encrypted-devices.nix

virtualisation.fileSystems.<name>.fsType

Type of the file system. Type: string (with check: non-empty)

Default

"auto"

Example

"ext3"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems.nix

virtualisation.fileSystems.<name>.label

Label of the device (if any). Type: null or string (with check: non-empty)

Default

null

Example

"root-partition"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems.nix

virtualisation.fileSystems.<name>.mountPoint

Location of the mounted file system. Type: string (with check: non-empty without trailing slash)

Example

"/mnt/usb"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems.nix

virtualisation.fileSystems.<name>.neededForBoot

If set, this file system will be mounted in the initial ramdisk. Note that the file system will always be mounted in the initial ramdisk if its mount point is one of the following: {file}/, {file}/nix, {file}/nix/store, {file}/var, {file}/var/log, {file}/var/lib, {file}/var/lib/nixos, {file}/etc, {file}/usr.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/system/boot/stage-1.nix

virtualisation.fileSystems.<name>.noCheck

Disable running fsck on this filesystem. Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems.nix

virtualisation.fileSystems.<name>.options

Options used to mount the file system. Type: non-empty (list of string (with check: non-empty))

Default

["defaults"]

Example

["data=journal"]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems.nix

virtualisation.fileSystems.<name>.overlay.lowerdir

The list of path(s) to the lowerdir(s).

To create a writable overlay, you MUST provide an upperdir and a workdir.

You can create a read-only overlay when you provide multiple (at least 2!) lowerdirs and neither an upperdir nor a workdir.

Type: null or (non-empty (list of (string or path in the Nix store)))

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems/overlayfs.nix

virtualisation.fileSystems.<name>.overlay.upperdir

The path to the upperdir.

If this is null, a read-only overlay is created using the lowerdir.

If you set this to some value you MUST also set workdir.

Type: null or string

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems/overlayfs.nix

virtualisation.fileSystems.<name>.overlay.workdir

The path to the workdir.

This MUST be set if you set upperdir.

Type: null or string

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems/overlayfs.nix

virtualisation.fileSystems.<name>.stratis.poolUuid

UUID of the stratis pool that the fs is located in

Type: null or string

Default

null

Example

"04c68063-90a5-4235-b9dd-6180098a20d9"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/filesystems.nix