refactor: moved nixos modules to dendrite pattern
This commit is contained in:
parent
df8dd110ad
commit
0ea11e0236
219 changed files with 4802 additions and 4820 deletions
90
modules/nixos/storage/dataset.nix
Normal file
90
modules/nixos/storage/dataset.nix
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
{...}: let
|
||||
submodule = {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 = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
description = "Controls the mount point used for this file system";
|
||||
default = null;
|
||||
};
|
||||
|
||||
encryption = {
|
||||
enable = lib.mkEnableOption "should encryption be enabled";
|
||||
type = lib.mkOption {
|
||||
type = lib.types.enum ["aes-128-ccm" "aes-192-ccm" "aes-256-ccm" "aes-128-gcm" "aes-192-gcm" "aes-256-gcm"];
|
||||
description = "What encryption type to use";
|
||||
};
|
||||
keyformat = lib.mkOption {
|
||||
type = lib.types.enum ["raw" "hex" "passphrase"];
|
||||
description = "Format of the encryption key";
|
||||
};
|
||||
keylocation = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Location of the encryption key";
|
||||
};
|
||||
};
|
||||
|
||||
snapshot = {
|
||||
# This option should set this option flag
|
||||
autoSnapshot = lib.mkEnableOption "Enable automatic snapshots for this dataset";
|
||||
# Creates a blank snapshot in the post create hook for rollback purposes
|
||||
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";
|
||||
};
|
||||
};
|
||||
};
|
||||
in {
|
||||
flake.commonModules.storage-dataset-submodule = submodule;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue