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
34
modules/nixos/programs/sync/storage.nix
Normal file
34
modules/nixos/programs/sync/storage.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{...}: {
|
||||
flake.nixosModules.sync-storage = {
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
mountDir = "/mnt/sync";
|
||||
configDir = "/etc/syncthing";
|
||||
in {
|
||||
options = {
|
||||
services.syncthing.impermanence.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = config.services.syncthing.enable && config.storage.impermanence.enable;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.services.syncthing.enable {
|
||||
storage.datasets.replicate."system/root" = {
|
||||
directories = {
|
||||
"${mountDir}" = lib.mkIf config.services.syncthing.impermanence.enable {
|
||||
enable = true;
|
||||
owner.name = "syncthing";
|
||||
group.name = "syncthing";
|
||||
};
|
||||
"${configDir}" = lib.mkIf config.services.syncthing.impermanence.enable {
|
||||
enable = true;
|
||||
owner.name = "syncthing";
|
||||
group.name = "syncthing";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue