From 3fc4d0bf809ced79313d462937c5c4a86229d46d Mon Sep 17 00:00:00 2001 From: Toast Date: Thu, 31 Aug 2023 21:42:52 +0200 Subject: [PATCH 1/5] Everest: remove redundant firewall config --- machines/Everest/configuration.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/machines/Everest/configuration.nix b/machines/Everest/configuration.nix index fd2f6de..1d88a68 100755 --- a/machines/Everest/configuration.nix +++ b/machines/Everest/configuration.nix @@ -59,10 +59,9 @@ }; # Open ports in the firewall. - # 8384 is syncthing's webui, and 22000 is syncthing related too - # No idea what 5201 and 21027 do tho - networking.firewall.allowedTCPPorts = [ 5201 8384 22000 ]; - networking.firewall.allowedUDPPorts = [ 5201 22000 21027]; + # No idea what ports 5201 and 21027 do tho + networking.firewall.allowedTCPPorts = [ 5201 ]; + networking.firewall.allowedUDPPorts = [ 5201 21027]; # Or disable the firewall altogether. # networking.firewall.enable = false; } From 559121da211f004e1451b234db2f2f589d458618 Mon Sep 17 00:00:00 2001 From: Toast Date: Thu, 31 Aug 2023 22:13:44 +0200 Subject: [PATCH 2/5] Desktop: configure syncthing --- roles/desktop/services/default.nix | 1 + roles/desktop/services/syncthing.nix | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 roles/desktop/services/syncthing.nix diff --git a/roles/desktop/services/default.nix b/roles/desktop/services/default.nix index 19921e3..6393486 100644 --- a/roles/desktop/services/default.nix +++ b/roles/desktop/services/default.nix @@ -4,5 +4,6 @@ imports = [ ./ssh-agent.nix ./flatpak.nix + ./syncthing.nix ]; } diff --git a/roles/desktop/services/syncthing.nix b/roles/desktop/services/syncthing.nix new file mode 100644 index 0000000..b6b09bf --- /dev/null +++ b/roles/desktop/services/syncthing.nix @@ -0,0 +1,10 @@ +{ config, ... }: + +{ + services.syncthing = { + enable = true; + user = "toast"; + group = "users"; + dataDir = config.users.users.toast.home; + }; +} From 052d072ea55d7bf21d5cf9d46c0f3d29b39f99a0 Mon Sep 17 00:00:00 2001 From: Toast Date: Thu, 31 Aug 2023 22:15:01 +0200 Subject: [PATCH 3/5] Syncthing: change path of passwords folder on desktop role --- roles/desktop/services/syncthing.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/desktop/services/syncthing.nix b/roles/desktop/services/syncthing.nix index b6b09bf..728dd0e 100644 --- a/roles/desktop/services/syncthing.nix +++ b/roles/desktop/services/syncthing.nix @@ -6,5 +6,6 @@ user = "toast"; group = "users"; dataDir = config.users.users.toast.home; + folders."passwords".path = "~/Documents/Passwords"; }; } From e6b6416bc3f272a0c95b2285699e0d4546050ee5 Mon Sep 17 00:00:00 2001 From: Toast Date: Thu, 31 Aug 2023 22:16:02 +0200 Subject: [PATCH 4/5] Common: add everest to syncthing --- roles/common/services/syncthing.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/common/services/syncthing.nix b/roles/common/services/syncthing.nix index 551063a..a647089 100755 --- a/roles/common/services/syncthing.nix +++ b/roles/common/services/syncthing.nix @@ -16,12 +16,16 @@ name = "Steam Deck"; id = "DLQPL74-KEQTPM5-X4PDZHB-4HLQYHV-UCMJLOB-P6W3KWU-QLJADBY-V4KEMA5"; }; + "server" = { + name = "Everest"; + id = "BVJBCAZ-WDIWBFR-CK3WB3N-TWH3UXX-EPZXVWE-BLQ3IDU-U7MHVVB-WO4BKAJ"; + }; }; folders = { "passwords" = { label = "KeePassXC Passwords"; id = "rdyaq-ex659"; - devices = [ "phone" "pc" "steamdeck"]; + devices = [ "phone" "pc" "steamdeck" "server"]; }; }; }; From 47c8ca29a03a2357c7078698065c926045777436 Mon Sep 17 00:00:00 2001 From: Toast Date: Thu, 31 Aug 2023 22:19:12 +0200 Subject: [PATCH 5/5] Common: set syncthing options --- roles/common/services/syncthing.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/roles/common/services/syncthing.nix b/roles/common/services/syncthing.nix index a647089..da9174f 100755 --- a/roles/common/services/syncthing.nix +++ b/roles/common/services/syncthing.nix @@ -1,8 +1,16 @@ { config, ... }: { - # Set up devices and folders common to every device services.syncthing = { + overrideDevices = true; + overrideFolders = true; + openDefaultPorts = true; + extraOptions = { + options = { + urAccepted = 3; + }; + }; + # Set up devices and folders common to every device devices = { "phone" = { name = "Xiaomi Redmi Note 10 Pro";