diff options
Diffstat (limited to 'nixos/modules/homelab/cloud/syncthing.nix')
| -rw-r--r-- | nixos/modules/homelab/cloud/syncthing.nix | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/nixos/modules/homelab/cloud/syncthing.nix b/nixos/modules/homelab/cloud/syncthing.nix index 993cf42..00328f7 100644 --- a/nixos/modules/homelab/cloud/syncthing.nix +++ b/nixos/modules/homelab/cloud/syncthing.nix @@ -3,6 +3,39 @@ in { options.homelab.cloud.syncthing = { enable = lib.mkEnableOption "syncthing"; - + user = lib.mkOption { + type = lib.types.str; + description = "The username of syncthing's user"; + }; + }; + config = lib.mkIf cfg.enable { + services.syncthing = { + enable = true; + user = cfg.user; + dataDir = "/home/${cfg.user}/Sync"; + configDir = "/home/${cfg.user}/.config/syncthing"; + overrideDevices = true; + overrideFolders = true; + settings = { + devices = { + "ideapad-laptop" = { + id = "62SPMAK-NOHX3QT-MVSOS7U-UON6YPH-HXXNFXO-PRSAJ2X-GYXFWJO-6LARPQL"; + }; + "nzxt-desktop" = { + id = "2TPKPXD-LO7OL7V-GP5HOUM-2P5SUEQ-XST4UYJ-S2Z56PP-IM66IIT-GLUNLAX"; + }; + "samsung-tablet" = { + id = "ZKL25GJ-TKM2E6Y-VQSBAW5-TVG7RWM-RRAUEVA-ZOJZNCM-F3ARZUU-TPK7CA6"; + }; + }; + folders = { + "Main" = { + path = "/home/${cfg.user}/Sync"; + devices = [ "ideapad-laptop" "nzxt-desktop" "samsung-tablet" ]; + }; + }; + }; + }; + environment.systemPackages = [ pkgs.syncthing ]; }; } |
