diff options
| author | triethyl <triethylammonium@pm.me> | 2025-09-02 21:21:46 -0400 |
|---|---|---|
| committer | triethyl <triethylammonium@pm.me> | 2025-09-02 21:21:46 -0400 |
| commit | efb1cda6d789e81cce0fafd753fb4d96eed6f9b7 (patch) | |
| tree | ca816fc9817e8c94d2c247ebb03357c867298621 /nixos/modules/homelab/cloud | |
| parent | a6f9533790b9bfb73f1e531fcef6303642e38983 (diff) | |
homelab: working on homelab
Diffstat (limited to 'nixos/modules/homelab/cloud')
| -rw-r--r-- | nixos/modules/homelab/cloud/default.nix | 6 | ||||
| -rw-r--r-- | nixos/modules/homelab/cloud/syncthing.nix | 35 |
2 files changed, 39 insertions, 2 deletions
diff --git a/nixos/modules/homelab/cloud/default.nix b/nixos/modules/homelab/cloud/default.nix index d4ee9df..24b067d 100644 --- a/nixos/modules/homelab/cloud/default.nix +++ b/nixos/modules/homelab/cloud/default.nix @@ -1 +1,5 @@ -{config, pkgs, lib, ...}: {} +{...}: { + imports = [ + ./syncthing.nix + ]; +} 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 ]; }; } |
