refactor: moved nixos modules to dendrite pattern
This commit is contained in:
parent
df8dd110ad
commit
0ea11e0236
219 changed files with 4802 additions and 4820 deletions
26
modules/nixos/programs/tailscale/storage.nix
Normal file
26
modules/nixos/programs/tailscale/storage.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{...}: {
|
||||
flake.nixosModules.tailscale-storage = {
|
||||
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";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue