aquaris.filesystem
tools
: List of extra packages available to the format & mount scriptsdisks.<name>
device
: Path to the disk device file (set via attribute name)type
: Partition table typepartSep
: Separator text between disk path and partition number. Examples:/dev/sda1
→ empty string/dev/nvme0n1p1
→ “p”/dev/disk/by-id/foo-part1
→ “-part”
partitions.<name>
device
: Path to the partition device file (set automatically via name of respective disk & position in partition list)type
: Partition type (read by sfdisk)size
: Size of the partition (null
fills remaining space on disk)content
: Can be afilesystem
orzpool
filesystem
type
: Filesystem type (read by mkfs)mkfsOpts
: Options for mkfsmountpoint
: Mount point of the filesystemmountOpts
: Options for mount
zpool
: should be a zpool reference (set via helper function, see example for more information)
zpools.<name>
name
: Name of the zpool (set via attribute name)poolOpts
: Options set on pool creationrootOpts
: Default options for all datasetsdatasets.<name>
name
: Name of the dataset (set via attribute name)mountpoint
: Mount point of the datasetoptions
: Extra options of the dataset
{
aquaris.filesystem =
# partition content helper functions
{ filesystem, zpool, ... }: {
disks = {
# no need to set partSep, as the default value "-part"
# works for disks referenced via /dev/disk/by-*
# (which is the recommended method)
"/dev/disk/by-id/foobar".partitions = [
{
type = "uefi"; # EFI system partition
size = "512M";
content = filesystem {
type = "vfat";
mountpoint = "/boot";
};
}
# zpool helper function:
# takes a function that extracts a pool
# from the set of all defined pools
{ content = zpool (p: p.rpool); }
];
};
zpools.rpool.datasets = {
# default mountpoint = all but the first part of the dataset name
"nixos/nix" = { }; # mountpoint = /nix
"nixos/home/user" = { }; # mountpoint = /home/user
# parent datasets are created automatically
# "nixos" = {};
# "nixos/home" = {};
};
};
}
See also the full example
This library exports two scripts & and accompanying executables
under nixosConfigurations.<name>.config.aquaris.filesystem
:
_formatScript
_format
_mountScript
_mount
The formatter will not delete zpools that are already defined. Both scripts create & manage dependent resources in the correct order, including bind mounts.
See also the installer template