33 lines
1.5 KiB
Nix
33 lines
1.5 KiB
Nix
args @ {lib, ...}: let
|
|
impermanenceDatasetSubmodules = (import ./submodules/impermanenceDataset.nix) args;
|
|
in {
|
|
options.storage = {
|
|
impermanence = {
|
|
enable = lib.mkEnableOption "should impermanence be enabled for this system";
|
|
# TODO: enable option implementation
|
|
|
|
# TODO: assertion that zfs needs to be enabled when impermanence is enabled
|
|
|
|
# TODO: datasets option that is a submodule that will be used to define what datasets to add to the storage system
|
|
# We should by default create the `local`, `local/system/nix`, `local/system/root`, `persist` `persist/system/root`, and `persist/system/var/log` datasets
|
|
# We should also create datasets for systemd modules that have have impermanence enabled for them
|
|
|
|
datasets = lib.mkOption {
|
|
type = lib.types.attrsOf (lib.types.submodule impermanenceDatasetSubmodules);
|
|
default = {};
|
|
};
|
|
|
|
# TODO: this should just live under home-manager.users.<user>.storage.impermanence
|
|
home-manager = lib.mkOption {
|
|
type = lib.types.attrsOf (lib.types.submodule ({name, ...}: {
|
|
enable = lib.mkEnableOption "should impermanence be enabled for this user";
|
|
# We should by default create the `local/home/${name}`, and `persist/home/${name}` datasets
|
|
datasets = lib.mkOption {
|
|
type = lib.types.attrsOf (lib.types.submodule impermanenceDatasetSubmodules);
|
|
default = {};
|
|
};
|
|
}));
|
|
};
|
|
};
|
|
};
|
|
}
|