33 lines
1 KiB
Nix
33 lines
1 KiB
Nix
{
|
|
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/replicate/system/root" = {
|
|
directories."/var/lib/panoramax" = {
|
|
owner.name = "panoramax";
|
|
group.name = "panoramax";
|
|
};
|
|
};
|
|
})
|
|
]))
|
|
]);
|
|
}
|