state: move options clanCore.state to a separate file
This commit is contained in:
parent
26e9463248
commit
9f8e719b48
@ -1,33 +1,8 @@
|
|||||||
{ lib, ... }:
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
options.clanCore.state = lib.mkOption {
|
imports = [
|
||||||
default = { };
|
./state.nix
|
||||||
type = lib.types.attrsOf
|
];
|
||||||
(lib.types.submodule ({ ... }: {
|
|
||||||
options = {
|
|
||||||
folders = lib.mkOption {
|
|
||||||
type = lib.types.listOf lib.types.str;
|
|
||||||
description = ''
|
|
||||||
Folder where state resides in
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
preRestoreScript = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = ":";
|
|
||||||
description = ''
|
|
||||||
script to run before restoring the state dir from a backup
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
postRestoreScript = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = ":";
|
|
||||||
description = ''
|
|
||||||
script to restore the service after the state dir was restored from a backup
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}));
|
|
||||||
};
|
|
||||||
options.clanCore.backups = {
|
options.clanCore.backups = {
|
||||||
providers = lib.mkOption {
|
providers = lib.mkOption {
|
||||||
type = lib.types.attrsOf (lib.types.submodule ({ name, ... }: {
|
type = lib.types.attrsOf (lib.types.submodule ({ name, ... }: {
|
||||||
|
31
nixosModules/clanCore/state.nix
Normal file
31
nixosModules/clanCore/state.nix
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
{ lib, ... }:
|
||||||
|
{
|
||||||
|
options.clanCore.state = lib.mkOption {
|
||||||
|
default = { };
|
||||||
|
type = lib.types.attrsOf
|
||||||
|
(lib.types.submodule ({ ... }: {
|
||||||
|
options = {
|
||||||
|
folders = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
description = ''
|
||||||
|
Folder where state resides in
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
preRestoreScript = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = ":";
|
||||||
|
description = ''
|
||||||
|
script to run before restoring the state dir from a backup
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
postRestoreScript = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = ":";
|
||||||
|
description = ''
|
||||||
|
script to restore the service after the state dir was restored from a backup
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user