From ad496dccf3ba15248c9312e9bf78b0ed50aec973 Mon Sep 17 00:00:00 2001 From: Swarsel Date: Thu, 17 Oct 2024 01:24:10 +0200 Subject: [PATCH] feat: winter details --- SwarselSystems.org | 192 +++++++++++++++--------- profiles/server/common/syncthing.nix | 22 +++ profiles/server/common/transmission.nix | 96 ++++++++---- 3 files changed, 213 insertions(+), 97 deletions(-) diff --git a/SwarselSystems.org b/SwarselSystems.org index 6d66e90..ff15711 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -7631,6 +7631,21 @@ Also, the system state version is set here. No need to touch it. group = "docker"; extraGroups = [ "users" ]; }; + radarr = { + extraGroups = [ "users" ]; + }; + readarr = { + extraGroups = [ "users" ]; + }; + sonarr = { + extraGroups = [ "users" ]; + }; + lidarr = { + extraGroups = [ "users" ]; + }; + prowlarr = { + extraGroups = [ "users" ]; + }; }; }; @@ -7642,18 +7657,27 @@ Also, the system state version is set here. No need to touch it. services = { radarr = { enable = true; + openFirewall = true; + dataDir = "/Vault/apps/radarr" }; readarr = { enable = true; + openFirewall = true; + dataDir = "/Vault/apps/readarr" }; sonarr = { enable = true; + openFirewall = true; + dataDir = "/Vault/apps/sonarr" }; lidarr = { enable = true; + openFirewall = true; + dataDir = "/Vault/apps/lidarr" }; prowlarr = { enable = true; + openFirewall = true; }; nginx = { @@ -7669,6 +7693,18 @@ Also, the system state version is set here. No need to touch it. client_max_body_size 0; ''; }; + "/radarr" = { + proxyPass = "http://127.0.0.1:8080"; + extraConfig = '' + client_max_body_size 0; + ''; + }; + "/sonarr" = { + proxyPass = "http://127.0.0.1:8080"; + extraConfig = '' + client_max_body_size 0; + ''; + }; }; }; }; @@ -7682,86 +7718,108 @@ Also, the system state version is set here. No need to touch it. **** syncthing #+begin_src nix :tangle profiles/server/common/syncthing.nix -{ pkgs, lib, config, ... }: -{ - config = lib.mkIf config.swarselsystems.server.syncthing { + { pkgs, lib, config, ... }: + { + config = lib.mkIf config.swarselsystems.server.syncthing { - users.users.syncthing = { - extraGroups = [ "users" ]; - }; + users.users.syncthing = { + extraGroups = [ "users" ]; + }; - services.syncthing = { - enable = true; - user = "syncthing"; - dataDir = "/Vault/data/syncthing"; - configDir = "/Vault/apps/syncthing"; - guiAddress = "0.0.0.0:8384"; - openDefaultPorts = true; - settings = { - devices = { - "magicant" = { - id = "VMWGEE2-4HDS2QO-KNQOVGN-LXLX6LA-666E4EK-ZBRYRRO-XFEX6FB-6E3XLQO"; + services.syncthing = { + enable = true; + user = "syncthing"; + dataDir = "/Vault/data/syncthing"; + configDir = "/Vault/apps/syncthing"; + guiAddress = "0.0.0.0:8384"; + openDefaultPorts = true; + settings = { + devices = { + "magicant" = { + id = "VMWGEE2-4HDS2QO-KNQOVGN-LXLX6LA-666E4EK-ZBRYRRO-XFEX6FB-6E3XLQO"; + }; + "zenfone9" = { + id = "SEH2NMT-IVRQUU5-VPW2HUQ-3GQYDBF-F6H6OY6-X3DZTUZ-LCRE2DJ-QNIXIQ2"; + }; + "sync (@oracle)" = { + id = "ETW6TST-NPK7MKZ-M4LXMHA-QUPQHDT-VTSHH5X-CR5EIN2-YU7E55F-MGT7DQB"; + }; + "nbl-imba-2" = { + id = "YAPV4BV-I26WPTN-SIP32MV-SQP5TBZ-3CHMTCI-Z3D6EP2-MNDQGLP-53FT3AB"; + }; }; - "zenfone9" = { - id = "SEH2NMT-IVRQUU5-VPW2HUQ-3GQYDBF-F6H6OY6-X3DZTUZ-LCRE2DJ-QNIXIQ2"; - }; - "sync (@oracle)" = { - id = "ETW6TST-NPK7MKZ-M4LXMHA-QUPQHDT-VTSHH5X-CR5EIN2-YU7E55F-MGT7DQB"; - }; - "nbl-imba-2" = { - id = "YAPV4BV-I26WPTN-SIP32MV-SQP5TBZ-3CHMTCI-Z3D6EP2-MNDQGLP-53FT3AB"; - }; - }; - folders = { - "Default Folder" = { - path = "/Vault/data/syncthing/Sync"; - devices = [ "sync (@oracle)" "magicant" "zenfone9" "nbl-imba-2" ]; - id = "default"; - }; - "Obsidian" = { - path = "/Vault/data/syncthing/Obsidian"; - devices = [ "sync (@oracle)" "magicant" "zenfone9" "nbl-imba-2" ]; - id = "yjvni-9eaa7"; - }; - "Org" = { - path = "/Vault/data/syncthing/Org"; - devices = [ "sync (@oracle)" "magicant" "zenfone9" "nbl-imba-2" ]; - id = "a7xnl-zjj3d"; - }; - "Vpn" = { - path = "/Vault/data/syncthing/Vpn"; - devices = [ "sync (@oracle)" "magicant" "zenfone9" "nbl-imba-2" ]; - id = "hgp9s-fyq3p"; - }; - "Documents" = { - path = "/Vault/data/syncthing/Documents"; - devices = [ "magicant" "nbl-imba-2" ]; - id = "hgr3d-pfu3w"; + folders = { + "Default Folder" = { + path = "/Vault/data/syncthing/Sync"; + type = "receiveonly"; + versioning = null; + devices = [ "sync (@oracle)" "magicant" "zenfone9" "nbl-imba-2" ]; + id = "default"; + }; + "Obsidian" = { + path = "/Vault/data/syncthing/Obsidian"; + type = "receiveonly"; + versioning = { + type = "simple"; + params.keep = "5"; + }; + devices = [ "sync (@oracle)" "magicant" "zenfone9" "nbl-imba-2" ]; + id = "yjvni-9eaa7"; + }; + "Org" = { + path = "/Vault/data/syncthing/Org"; + type = "receiveonly"; + versioning = { + type = "simple"; + params.keep = "5"; + }; + devices = [ "sync (@oracle)" "magicant" "zenfone9" "nbl-imba-2" ]; + id = "a7xnl-zjj3d"; + }; + "Vpn" = { + path = "/Vault/data/syncthing/Vpn"; + type = "receiveonly"; + versioning = { + type = "simple"; + params.keep = "5"; + }; + devices = [ "sync (@oracle)" "magicant" "zenfone9" "nbl-imba-2" ]; + id = "hgp9s-fyq3p"; + }; + "Documents" = { + path = "/Vault/data/syncthing/Documents"; + type = "receiveonly"; + versioning = { + type = "simple"; + params.keep = "5"; + }; + devices = [ "magicant" "nbl-imba-2" ]; + id = "hgr3d-pfu3w"; + }; }; }; }; - }; - services.nginx = { - virtualHosts = { - "storync.swarsel.win" = { - enableACME = true; - forceSSL = true; - acmeRoot = null; - locations = { - "/" = { - proxyPass = "http://localhost:8384/"; - extraConfig = '' - client_max_body_size 0; - ''; + services.nginx = { + virtualHosts = { + "storync.swarsel.win" = { + enableACME = true; + forceSSL = true; + acmeRoot = null; + locations = { + "/" = { + proxyPass = "http://localhost:8384/"; + extraConfig = '' + client_max_body_size 0; + ''; + }; }; }; }; }; }; - }; -} + } #+end_src diff --git a/profiles/server/common/syncthing.nix b/profiles/server/common/syncthing.nix index cffb68e..76804ba 100644 --- a/profiles/server/common/syncthing.nix +++ b/profiles/server/common/syncthing.nix @@ -31,26 +31,48 @@ folders = { "Default Folder" = { path = "/Vault/data/syncthing/Sync"; + type = "receiveonly"; + versioning = null; devices = [ "sync (@oracle)" "magicant" "zenfone9" "nbl-imba-2" ]; id = "default"; }; "Obsidian" = { path = "/Vault/data/syncthing/Obsidian"; + type = "receiveonly"; + versioning = { + type = "simple"; + params.keep = "5"; + }; devices = [ "sync (@oracle)" "magicant" "zenfone9" "nbl-imba-2" ]; id = "yjvni-9eaa7"; }; "Org" = { path = "/Vault/data/syncthing/Org"; + type = "receiveonly"; + versioning = { + type = "simple"; + params.keep = "5"; + }; devices = [ "sync (@oracle)" "magicant" "zenfone9" "nbl-imba-2" ]; id = "a7xnl-zjj3d"; }; "Vpn" = { path = "/Vault/data/syncthing/Vpn"; + type = "receiveonly"; + versioning = { + type = "simple"; + params.keep = "5"; + }; devices = [ "sync (@oracle)" "magicant" "zenfone9" "nbl-imba-2" ]; id = "hgp9s-fyq3p"; }; "Documents" = { path = "/Vault/data/syncthing/Documents"; + type = "receiveonly"; + versioning = { + type = "simple"; + params.keep = "5"; + }; devices = [ "magicant" "nbl-imba-2" ]; id = "hgr3d-pfu3w"; }; diff --git a/profiles/server/common/transmission.nix b/profiles/server/common/transmission.nix index 2595061..ac017f7 100644 --- a/profiles/server/common/transmission.nix +++ b/profiles/server/common/transmission.nix @@ -16,6 +16,21 @@ group = "docker"; extraGroups = [ "users" ]; }; + radarr = { + extraGroups = [ "users" ]; + }; + readarr = { + extraGroups = [ "users" ]; + }; + sonarr = { + extraGroups = [ "users" ]; + }; + lidarr = { + extraGroups = [ "users" ]; + }; + prowlarr = { + extraGroups = [ "users" ]; + }; }; }; @@ -27,37 +42,58 @@ services = { radarr = { enable = true; - }; - readarr = { - enable = true; - }; - sonarr = { - enable = true; - }; - lidarr = { - enable = true; - }; - prowlarr = { - enable = true; - }; + openFirewall = true; + dataDir = "/Vault/apps/radarr" + }; + readarr = { + enable = true; + openFirewall = true; + dataDir = "/Vault/apps/readarr" + }; + sonarr = { + enable = true; + openFirewall = true; + dataDir = "/Vault/apps/sonarr" + }; + lidarr = { + enable = true; + openFirewall = true; + dataDir = "/Vault/apps/lidarr" + }; + prowlarr = { + enable = true; + openFirewall = true; + }; - nginx = { - virtualHosts = { - "store.swarsel.win" = { - enableACME = false; - forceSSL = false; - acmeRoot = null; - locations = { - "/" = { - proxyPass = "http://127.0.0.1:9091"; - extraConfig = '' - client_max_body_size 0; - ''; + nginx = { + virtualHosts = { + "store.swarsel.win" = { + enableACME = false; + forceSSL = false; + acmeRoot = null; + locations = { + "/" = { + proxyPass = "http://127.0.0.1:9091"; + extraConfig = '' + client_max_body_size 0; + ''; + }; + "/radarr" = { + proxyPass = "http://127.0.0.1:8080"; + extraConfig = '' + client_max_body_size 0; + ''; + }; + "/sonarr" = { + proxyPass = "http://127.0.0.1:8080"; + extraConfig = '' + client_max_body_size 0; + ''; + }; + }; + }; + }; }; }; }; - }; - }; - }; - }; -} + }