{lib, ...}: {name, ...}: { options = { type = lib.mkOption { type = lib.types.enum ["zfs_fs" "zfs_volume"]; default = "zfs_fs"; description = "Type of ZFS dataset (filesystem or volume)"; }; acltype = lib.mkOption { type = lib.types.nullOr (lib.types.enum ["off" "nfsv4" "posixacl"]); default = null; description = "Access control list type"; }; relatime = lib.mkOption { type = lib.types.nullOr (lib.types.enum ["on" "off"]); default = null; description = "Controls when access time is updated"; }; atime = lib.mkOption { type = lib.types.nullOr (lib.types.enum ["on" "off"]); default = null; description = "Controls whether access time is updated"; }; xattr = lib.mkOption { type = lib.types.nullOr (lib.types.enum ["on" "off" "sa" "dir"]); default = null; description = "Extended attribute storage method"; }; compression = lib.mkOption { type = lib.types.nullOr (lib.types.enum ["on" "off" "lz4" "gzip" "zstd" "lzjb" "zle"]); default = null; description = "Compression algorithm to use"; }; sync = lib.mkOption { type = lib.types.nullOr (lib.types.enum ["standard" "always" "disabled"]); default = null; description = "Synchronous write behavior"; }; mount = { enable = lib.mkOption { type = lib.types.nullOr (lib.types.either lib.types.bool (lib.types.enum ["on" "off" "noauto"])); default = null; }; mountPoint = lib.mkOption { type = lib.types.nullOr lib.types.str; default = null; description = "Controls the mount point used for this file system"; }; }; encryption = { enable = lib.mkEnableOption "should encryption be enabled"; type = lib.mkOption { type = lib.types.nullOr (lib.types.enum ["aes-128-ccm" "aes-192-ccm" "aes-256-ccm" "aes-128-gcm" "aes-192-gcm" "aes-256-gcm"]); default = null; description = "What encryption type to use"; }; keyformat = lib.mkOption { type = lib.types.nullOr (lib.types.enum ["raw" "hex" "passphrase"]); default = null; description = "Format of the encryption key"; }; keylocation = lib.mkOption { type = lib.types.nullOr lib.types.str; default = null; description = "Location of the encryption key"; }; }; snapshot = { # This option should set this option flag # "com.sun:auto-snapshot" = "false"; autoSnapshot = lib.mkOption { type = lib.types.nullOr lib.types.bool; default = null; description = "Enable automatic snapshots for this dataset"; }; # TODO: this is what blank snapshot should set # postCreateHook = '' # zfs snapshot rpool/local/system/root@blank # ''; blankSnapshot = lib.mkEnableOption "Should a blank snapshot be auto created in the post create hook"; }; recordSize = lib.mkOption { type = lib.types.nullOr lib.types.str; default = null; description = "Suggested block size for files in the file system"; }; postCreateHook = lib.mkOption { type = lib.types.str; default = ""; description = "Script to run after dataset creation"; }; }; }