1.5 KiB
1.5 KiB
ZFS Block
Defined in /modules/blocks/zfs.nix:
{
inputs,
...
}:
{
imports = [
inputs.selfhostblocks.nixosModules.zfs
];
}
This block creates ZFS datasets, optionally mounts them and sets permissions on the mount point.
Features
- Creates ZFS dataset which is optionally mounted.
- Sets permissions, owner, group and ACL on the mount point.
Usage
Create a dataset at root/safe/users mounted on /var/lib/nixos:
shb.zfs.pools.root.datasets."safe/users".path = "/var/lib/nixos";
Create a dataset at backup/syncoid but do not mount it:
shb.zfs.pools.backup.datasets."syncoid".path = "none";
Create a dataset at root/syncthing and set custom permissions and ACL.
Permission and ACL are only enforced for the mount point.
shb.zfs.pools.root.datasets."syncthing" = {
path = "/srv/syncthing";
mode = "ug=rwx,g+s,o=";
owner = "syncthing";
group = "syncthing";
defaultACLs = "g:syncthing:rwX";
};
Options Reference
id-prefix: blocks-zfs-options-
list-id: selfhostblocks-block-zfs-options
source: @OPTIONS_JSON@