2024-01-10 10:10:10 +00:00
|
|
|
{ lib, ... }:
|
|
|
|
{
|
2024-01-10 10:37:40 +00:00
|
|
|
# defaults
|
2024-03-17 18:48:49 +00:00
|
|
|
config.clanCore.state.HOME.folders = [ "/home" ];
|
2024-01-10 10:37:40 +00:00
|
|
|
|
|
|
|
# interface
|
2024-01-10 10:10:10 +00:00
|
|
|
options.clanCore.state = lib.mkOption {
|
|
|
|
default = { };
|
2024-03-17 18:48:49 +00:00
|
|
|
type = lib.types.attrsOf (
|
|
|
|
lib.types.submodule (
|
|
|
|
{ ... }:
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
folders = lib.mkOption {
|
|
|
|
type = lib.types.listOf lib.types.str;
|
|
|
|
description = ''
|
|
|
|
Folder where state resides in
|
|
|
|
'';
|
|
|
|
};
|
2024-03-20 06:49:27 +00:00
|
|
|
preRestoreCommand = lib.mkOption {
|
|
|
|
type = lib.types.nullOr lib.types.str;
|
|
|
|
default = null;
|
2024-03-17 18:48:49 +00:00
|
|
|
description = ''
|
|
|
|
script to run before restoring the state dir from a backup
|
2024-01-15 09:03:47 +00:00
|
|
|
|
2024-03-17 18:48:49 +00:00
|
|
|
Utilize this to stop services which currently access these folders
|
|
|
|
'';
|
|
|
|
};
|
2024-03-20 06:49:27 +00:00
|
|
|
postRestoreCommand = lib.mkOption {
|
|
|
|
type = lib.types.nullOr lib.types.str;
|
|
|
|
default = null;
|
2024-03-17 18:48:49 +00:00
|
|
|
description = ''
|
|
|
|
script to restore the service after the state dir was restored from a backup
|
2024-01-15 09:03:47 +00:00
|
|
|
|
2024-03-17 18:48:49 +00:00
|
|
|
Utilize this to start services which were previously stopped
|
|
|
|
'';
|
|
|
|
};
|
2024-01-10 10:10:10 +00:00
|
|
|
};
|
2024-03-17 18:48:49 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
);
|
2024-01-10 10:10:10 +00:00
|
|
|
};
|
|
|
|
}
|