24 lines
607 B
Nix
24 lines
607 B
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
tailscale_data_directory = "/var/lib/tailscale";
|
|
in {
|
|
options = {
|
|
services.tailscale.impermanence.enable = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = config.services.tailscale.enable && config.storage.impermanence.enable;
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf config.services.tailscale.enable {
|
|
storage.datasets.replicate."system/root" = {
|
|
directories."${tailscale_data_directory}" = lib.mkIf config.services.tailscale.impermanence.enable {
|
|
enable = true;
|
|
owner.name = "root";
|
|
group.name = "root";
|
|
};
|
|
};
|
|
};
|
|
}
|