feat: refactored impermanence modules to follow new pattern
This commit is contained in:
parent
3ca0e9bf0a
commit
b67be1472a
54 changed files with 718 additions and 640 deletions
33
modules/nixos-modules/server/panoramax/storage.nix
Normal file
33
modules/nixos-modules/server/panoramax/storage.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
options.services.panoramax.impermanence.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = config.services.panoramax.enable && config.storage.impermanence.enable;
|
||||
};
|
||||
|
||||
config = lib.mkIf config.services.panoramax.enable (lib.mkMerge [
|
||||
(lib.mkIf config.storage.zfs.enable (lib.mkMerge [
|
||||
{
|
||||
# TODO: configure impermanence for panoramax data
|
||||
# This would typically include directories like:
|
||||
# - /var/lib/panoramax
|
||||
# - panoramax storage directories
|
||||
# - any cache or temporary directories that need to persist
|
||||
}
|
||||
(lib.mkIf (!config.services.panoramax.impermanence.enable) {
|
||||
# TODO: placeholder to configure a unique dataset for this service
|
||||
})
|
||||
(lib.mkIf config.services.panoramax.impermanence.enable {
|
||||
storage.impermanence.datasets."persist/system/root" = {
|
||||
directories."/var/lib/panoramax" = {
|
||||
owner.name = "panoramax";
|
||||
group.name = "panoramax";
|
||||
};
|
||||
};
|
||||
})
|
||||
]))
|
||||
]);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue