fix: added missing datasets to config
This commit is contained in:
parent
6ce567a53b
commit
65e0c6e0e5
7 changed files with 185 additions and 42 deletions
|
|
@ -22,23 +22,33 @@ args @ {
|
|||
# Find options that are only in impermanence datasets (not in regular ZFS datasets)
|
||||
impermanenceOnlyOptions = lib.lists.subtractLists regularDatasetOptions impermanenceDatasetOptions;
|
||||
in {
|
||||
options.storage.datasets = {
|
||||
ephemeral = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.submodule datasetSubmodule);
|
||||
default = {};
|
||||
options.storage = {
|
||||
generateBase = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
When enabled, enables automatic generation of base datasets (ephemeral, local, replicate roots).
|
||||
This allows manual definition of datasets matching an existing system layout for migration purposes.
|
||||
'';
|
||||
};
|
||||
local = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.submodule impermanenceDatasetSubmodule);
|
||||
default = {};
|
||||
};
|
||||
replicate = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.submodule impermanenceDatasetSubmodule);
|
||||
default = {};
|
||||
datasets = {
|
||||
ephemeral = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.submodule datasetSubmodule);
|
||||
default = {};
|
||||
};
|
||||
local = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.submodule impermanenceDatasetSubmodule);
|
||||
default = {};
|
||||
};
|
||||
replicate = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.submodule impermanenceDatasetSubmodule);
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf config.storage.zfs.enable {
|
||||
(lib.mkIf (config.storage.zfs.enable && config.storage.generateBase) {
|
||||
# Create ZFS datasets based on storage.datasets configuration
|
||||
storage.datasets = {
|
||||
local = {
|
||||
|
|
@ -55,7 +65,7 @@ in {
|
|||
};
|
||||
};
|
||||
})
|
||||
(lib.mkIf (config.storage.zfs.enable && config.storage.impermanence.enable) {
|
||||
(lib.mkIf (config.storage.zfs.enable && config.storage.impermanence.enable && config.storage.generateBase) {
|
||||
storage.datasets = {
|
||||
ephemeral = {
|
||||
"" = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue