refactor: moved modules to legacy-modules
This commit is contained in:
parent
d646b954ac
commit
db7ac35613
233 changed files with 5 additions and 5 deletions
32
legacy-modules/nixos-modules/sync/storage.nix
Normal file
32
legacy-modules/nixos-modules/sync/storage.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
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