diff --git a/systems/jeeves/configuration.nix b/systems/jeeves/configuration.nix index 413566c..13a3630 100644 --- a/systems/jeeves/configuration.nix +++ b/systems/jeeves/configuration.nix @@ -1,5 +1,6 @@ { pkgs, ... }: { + imports = [ ../../users/richie/syncthing_base.nix ]; networking = { hostId = "1beb3027"; @@ -75,67 +76,49 @@ sysstat.enable = true; - syncthing = { - enable = true; - user = "richie"; - overrideDevices = true; - overrideFolders = true; - dataDir = "/home/richie/Syncthing"; - configDir = "/home/richie/.config/syncthing"; - guiAddress = "192.168.90.40:8384"; - settings = { - devices = { - "Phone" = { - id = "LTGPLAE-M4ZDJTM-TZ3DJGY-SLLAVWF-CQDVEVS-RGCS75T-GAPZYK3-KUM6LA5"; - }; - "rhapsody-in-green" = { - id = "INKUNKN-KILXGL5-2TQ5JTH-ORJOLOM-WYD2PYO-YRDLQIX-3AKZFWT-ZN7OJAE"; - }; - }; - folders = { - "notes" = { - id = "l62ul-lpweo"; - path = "/ZFS/Media/Notes"; - devices = [ - "Phone" - "rhapsody-in-green" - ]; - fsWatcherEnabled = true; - }; - "books" = { - id = "6uppx-vadmy"; - path = "/ZFS/Storage/Syncthing/books"; - devices = [ - "Phone" - "rhapsody-in-green" - ]; - fsWatcherEnabled = true; - }; - "important" = { - id = "4ckma-gtshs"; - path = "/ZFS/Storage/Syncthing/important"; - devices = [ - "Phone" - "rhapsody-in-green" - ]; - fsWatcherEnabled = true; - }; - "music" = { - id = "vprc5-3azqc"; - path = "/ZFS/Storage/Syncthing/music"; - devices = [ - "Phone" - "rhapsody-in-green" - ]; - fsWatcherEnabled = true; - }; - "projects" = { - id = "vyma6-lqqrz"; - path = "/ZFS/Storage/Syncthing/projects"; - devices = [ "rhapsody-in-green" ]; - fsWatcherEnabled = true; - }; - }; + syncthing.guiAddress = "192.168.90.40:8384"; + syncthing.folders = { + "notes" = { + id = "l62ul-lpweo"; + path = "/ZFS/Media/Notes"; + devices = [ + "phone" + "rhapsody-in-green" + ]; + fsWatcherEnabled = true; + }; + "books" = { + id = "6uppx-vadmy"; + path = "/ZFS/Storage/Syncthing/books"; + devices = [ + "phone" + "rhapsody-in-green" + ]; + fsWatcherEnabled = true; + }; + "important" = { + id = "4ckma-gtshs"; + path = "/ZFS/Storage/Syncthing/important"; + devices = [ + "phone" + "rhapsody-in-green" + ]; + fsWatcherEnabled = true; + }; + "music" = { + id = "vprc5-3azqc"; + path = "/ZFS/Storage/Syncthing/music"; + devices = [ + "phone" + "rhapsody-in-green" + ]; + fsWatcherEnabled = true; + }; + "projects" = { + id = "vyma6-lqqrz"; + path = "/ZFS/Storage/Syncthing/projects"; + devices = [ "rhapsody-in-green" ]; + fsWatcherEnabled = true; }; }; diff --git a/users/richie/home/vscode/settings.json b/users/richie/home/vscode/settings.json index e48dc9b..32a5fc1 100644 --- a/users/richie/home/vscode/settings.json +++ b/users/richie/home/vscode/settings.json @@ -26,5 +26,6 @@ "update.mode": "none", "redhat.telemetry.enabled": true, // force the use of rust-analyzer from dev shell - "rust-analyzer.server.path": "rust-analyzer" + "rust-analyzer.server.path": "rust-analyzer", + "cSpell.userWords": ["syncthing"] } diff --git a/users/richie/secrets.yaml b/users/richie/secrets.yaml index 644d029..8e58f87 100644 --- a/users/richie/secrets.yaml +++ b/users/richie/secrets.yaml @@ -1,5 +1,7 @@ richie: user-password: ENC[AES256_GCM,data:l1WF7bwzEDKoDh3lv60H2A35ndPmTSsBQeso8YksZO4UstOjtSKFF5IZJYlE6Amonl9ZFUsQFtgVN+Rg2Yh/rmlI1TBL7CZDadlYIueQh8Si1Xr6qJJMBxqT/dV7G9tH24auUVdWc7tfoEYh6qZ+n9JR47H73A==,iv:d/Xe6qxaNSWo//gPES4h1XqWPGjALQ2316LPPZZyM68=,tag:2lJEc7UrpdmeAVfNXxy7Kw==,type:str] +syncthing: + password: ENC[AES256_GCM,data:iITyXH47YLdbD4t7k27SFpfN,iv:jzBh69brKJSxLNCd/ntY7O/GcpjmGc1Gli7yuxwwe2E=,tag:6fglnQjYXCnilgy8p+KWuw==,type:str] sops: kms: [] gcp_kms: [] @@ -42,8 +44,8 @@ sops: ZjFHcmtnd3lPbVdjSDVBenlBR0FOV28KwcBVT9q/OKnMvAkrWe9/+HB2qknSOurA nKDYMNExyE6K/uOKKbkH0ucaYBN+7+/b50nfUl5i/tfJvIUaWkwQUg== -----END AGE ENCRYPTED FILE----- - lastmodified: "2024-02-03T22:08:10Z" - mac: ENC[AES256_GCM,data:KUhn+0srLHqmHVPYuJV8L5CClgSABxvknaZ7DZQU8goQ9CpM6LIdys+VdsbOYPAcO/lVSzgtjX3/umuDDsJbAEwTXoJZWITCVNYXJDNvYSDke5ZSrl/xq9UugJHyvzX9HOnKXkLsxNU+VrA9EBUfrTWoYnaz+NPes9com1efvqY=,iv:GV5eIFNJuQPJliSOOb2ebkjX99WHbOtSjl1kHrAnTyc=,tag:iuFqrBbQk4ruk733pxDgoA==,type:str] + lastmodified: "2024-04-13T12:49:06Z" + mac: ENC[AES256_GCM,data:vvdCKlN4vbyKG3IY4q+n9t6aPzgA0ypBIhkmvZkuturKXtgD3AlRXpr1tfWACMCby16/sAOpC7z/KSV+bIW7ALxRhO/e8RZzqjxuUWn9l1V84t2Ydz3yeDH37aU/4w6ACdjQZLJAA/Z7a8FiFl1AcFK5VQrgFx1OFPstMdht8Ek=,iv:p35BFUoKJRtNKkSlUzy1aSYiy+NzxSIAFZ2eFt5sRiI=,tag:dPPEWLeJzpB5Eoi+pX0zIA==,type:str] pgp: - created_at: "2024-04-03T21:19:44Z" enc: |- diff --git a/users/richie/syncthing_base.nix b/users/richie/syncthing_base.nix new file mode 100644 index 0000000..27c4198 --- /dev/null +++ b/users/richie/syncthing_base.nix @@ -0,0 +1,33 @@ +{ config, ... }: + +{ + services.syncthing = { + enable = true; + user = "richie"; + overrideDevices = true; + overrideFolders = true; + dataDir = "/home/richie/Syncthing"; + configDir = "/home/richie/.config/syncthing"; + settings = { + gui = { + user = "richie"; + password.from_command = [ + "/usr/bin/env" + "cat" + "${config.sops.secrets."syncthing/password".path}" + ]; + }; + devices = { + phone.id = "LTGPLAE-M4ZDJTM-TZ3DJGY-SLLAVWF-CQDVEVS-RGCS75T-GAPZYK3-KUM6LA5"; + jeeves.id = "7YQ4UEW-OPQEBH4-6YKJH4B-ZCE3SAX-5EIK5JL-WJDIWUA-WA2N3D5-MNK6GAV"; + rhapsody-in-green.id = "INKUNKN-KILXGL5-2TQ5JTH-ORJOLOM-WYD2PYO-YRDLQIX-3AKZFWT-ZN7OJAE"; + }; + }; + }; + sops = { + defaultSopsFile = ./secrets.yaml; + secrets = { + "syncthing/password".owner = "richie"; + }; + }; +} diff --git a/users/richie/systems/rhapsody-in-green/configuration.nix b/users/richie/systems/rhapsody-in-green/configuration.nix index ef80196..a614ddc 100644 --- a/users/richie/systems/rhapsody-in-green/configuration.nix +++ b/users/richie/systems/rhapsody-in-green/configuration.nix @@ -1,9 +1,8 @@ -{ config, pkgs, ... }: - { imports = [ ../programs.nix ./hardware.nix + ../../syncthing_base.nix ]; nixpkgs.config.allowUnfree = true; @@ -45,66 +44,48 @@ pulse.enable = true; }; - syncthing = { - enable = true; - user = "richie"; - overrideDevices = true; - overrideFolders = true; - dataDir = "/home/richie/Syncthing"; - configDir = "/home/richie/.config/syncthing"; - settings = { - devices = { - "Phone" = { - id = "LTGPLAE-M4ZDJTM-TZ3DJGY-SLLAVWF-CQDVEVS-RGCS75T-GAPZYK3-KUM6LA5"; - }; - "jeeves" = { - id = "7YQ4UEW-OPQEBH4-6YKJH4B-ZCE3SAX-5EIK5JL-WJDIWUA-WA2N3D5-MNK6GAV"; - }; - }; - folders = { - "notes" = { - id = "l62ul-lpweo"; - path = "/home/richie/notes"; - devices = [ - "Phone" - "jeeves" - ]; - fsWatcherEnabled = true; - }; - "books" = { - id = "6uppx-vadmy"; - path = "/home/richie/books"; - devices = [ - "Phone" - "jeeves" - ]; - fsWatcherEnabled = true; - }; - "important" = { - id = "4ckma-gtshs"; - path = "/home/richie/important"; - devices = [ - "Phone" - "jeeves" - ]; - fsWatcherEnabled = true; - }; - "music" = { - id = "vprc5-3azqc"; - path = "/home/richie/music"; - devices = [ - "Phone" - "jeeves" - ]; - "projects" = { - id = "vyma6-lqqrz"; - path = "/ZFS/Storage/Syncthing/projects"; - devices = [ "jeeves" ]; - fsWatcherEnabled = true; - }; - fsWatcherEnabled = true; - }; + syncthing.settings.folders = { + "notes" = { + id = "l62ul-lpweo"; + path = "/home/richie/notes"; + devices = [ + "phone" + "jeeves" + ]; + fsWatcherEnabled = true; + }; + "books" = { + id = "6uppx-vadmy"; + path = "/home/richie/books"; + devices = [ + "phone" + "jeeves" + ]; + fsWatcherEnabled = true; + }; + "important" = { + id = "4ckma-gtshs"; + path = "/home/richie/important"; + devices = [ + "phone" + "jeeves" + ]; + fsWatcherEnabled = true; + }; + "music" = { + id = "vprc5-3azqc"; + path = "/home/richie/music"; + devices = [ + "phone" + "jeeves" + ]; + "projects" = { + id = "vyma6-lqqrz"; + path = "/ZFS/Storage/Syncthing/projects"; + devices = [ "jeeves" ]; + fsWatcherEnabled = true; }; + fsWatcherEnabled = true; }; };