From 2d1cc02293df2367df2675d3e87f6e29acd960b9 Mon Sep 17 00:00:00 2001 From: gwg313 Date: Mon, 20 Apr 2026 15:54:54 -0400 Subject: [PATCH] add syncthing --- .gitignore | 1 + modules/nixos/hosts/candlekeep/syncthing.nix | 14 ++- modules/nixos/hosts/candlekeep/zerotier.nix | 17 ++++ modules/nixos/hosts/grymforge/syncthing.nix | 92 ++++++++++++++++++++ modules/nixos/hosts/grymforge/zerotier.nix | 17 ++++ 5 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 modules/nixos/hosts/candlekeep/zerotier.nix create mode 100644 modules/nixos/hosts/grymforge/syncthing.nix create mode 100644 modules/nixos/hosts/grymforge/zerotier.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..304ed32 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.stfolder/ diff --git a/modules/nixos/hosts/candlekeep/syncthing.nix b/modules/nixos/hosts/candlekeep/syncthing.nix index 93dac43..81ea73d 100644 --- a/modules/nixos/hosts/candlekeep/syncthing.nix +++ b/modules/nixos/hosts/candlekeep/syncthing.nix @@ -62,7 +62,19 @@ }; "zettelkasten" = { - path = "/home/gwg313/zettelkasten/"; + path = "/home/gwg313/my-notes/"; + devices = [ "grymforge" ]; + versioning = { + type = "staggered"; + params = { + cleanInterval = "3600"; + maxAge = "15768000"; + }; + }; + }; + + "nix-config" = { + path = "/home/gwg313/nix-config/"; devices = [ "grymforge" ]; versioning = { type = "staggered"; diff --git a/modules/nixos/hosts/candlekeep/zerotier.nix b/modules/nixos/hosts/candlekeep/zerotier.nix new file mode 100644 index 0000000..6669779 --- /dev/null +++ b/modules/nixos/hosts/candlekeep/zerotier.nix @@ -0,0 +1,17 @@ +{ + ... +}: +{ + services.zerotierone = { + joinNetworks = [ + "ebe7fbd445359e9d" + ]; + enable = true; + }; + + networking.extraHosts = '' + 192.168.194.54 graphene.zt + 192.168.191.218 candlekeep.zt + 192.168.191.201 grymforge.zt + ''; +} diff --git a/modules/nixos/hosts/grymforge/syncthing.nix b/modules/nixos/hosts/grymforge/syncthing.nix new file mode 100644 index 0000000..6db4bcd --- /dev/null +++ b/modules/nixos/hosts/grymforge/syncthing.nix @@ -0,0 +1,92 @@ +{ + config, + user, + inputs, + ... +}: +{ + services.syncthing = { + enable = true; + dataDir = "/home/gwg313"; + openDefaultPorts = true; + configDir = "/home/gwg313/.config/syncthing"; + user = "gwg313"; + group = "users"; + guiAddress = "127.0.0.1:8384"; + + overrideDevices = true; + overrideFolders = true; + + settings = { + gui = { + user = inputs.secrets.syncthing.gui_user; + password = inputs.secrets.syncthing.gui_password; + }; + devices = { + "candlekeep" = { + id = inputs.secrets.syncthing.candlekeep_id; + }; + }; + + folders = { + "repos" = { + path = "/home/gwg313/repos"; + devices = [ "candlekeep" ]; + versioning = { + type = "staggered"; + params = { + cleanInterval = "3600"; + maxAge = "15768000"; + }; + }; + }; + "documents" = { + path = "/home/gwg313/Documents"; + devices = [ "candlekeep" ]; + versioning = { + type = "staggered"; + params = { + cleanInterval = "3600"; + maxAge = "15768000"; + }; + }; + }; + "password-store" = { + path = "/home/gwg313/.local/share/password-store"; + devices = [ "candlekeep" ]; + versioning = { + type = "staggered"; + params = { + cleanInterval = "3600"; + maxAge = "15768000"; + }; + }; + }; + + "zettelkasten" = { + path = "/home/gwg313/my-notes/"; + devices = [ "candlekeep" ]; + versioning = { + type = "staggered"; + params = { + cleanInterval = "3600"; + maxAge = "15768000"; + }; + }; + }; + + "nix-config" = { + path = "/home/gwg313/nix-config/"; + devices = [ "candlekeep" ]; + versioning = { + type = "staggered"; + params = { + cleanInterval = "3600"; + maxAge = "15768000"; + }; + }; + }; + }; + }; + }; +} diff --git a/modules/nixos/hosts/grymforge/zerotier.nix b/modules/nixos/hosts/grymforge/zerotier.nix new file mode 100644 index 0000000..6669779 --- /dev/null +++ b/modules/nixos/hosts/grymforge/zerotier.nix @@ -0,0 +1,17 @@ +{ + ... +}: +{ + services.zerotierone = { + joinNetworks = [ + "ebe7fbd445359e9d" + ]; + enable = true; + }; + + networking.extraHosts = '' + 192.168.194.54 graphene.zt + 192.168.191.218 candlekeep.zt + 192.168.191.201 grymforge.zt + ''; +}