From c51987536a16e8139a6b27ca5100f7e8dfdf192f Mon Sep 17 00:00:00 2001 From: "RingOfStorms (Joshua Bell)" Date: Mon, 23 Jun 2025 17:50:09 -0500 Subject: [PATCH] fix up nixarr links and add homarr for nav --- hosts/h001/containers/default.nix | 14 +++----- hosts/h001/containers/homarr.nix | 47 ++++++++++++++++++++++++++ hosts/h001/containers/opengist.nix | 2 +- hosts/h001/mods/adguardhome.nix | 25 +------------- hosts/h001/mods/nixarr.nix | 54 ------------------------------ 5 files changed, 54 insertions(+), 88 deletions(-) create mode 100644 hosts/h001/containers/homarr.nix diff --git a/hosts/h001/containers/default.nix b/hosts/h001/containers/default.nix index fc34091..fcef362 100644 --- a/hosts/h001/containers/default.nix +++ b/hosts/h001/containers/default.nix @@ -10,6 +10,7 @@ in # common.nixosModules.containers.librechat common.nixosModules.containers.forgejo ./opengist.nix + ./homarr.nix ]; config = { @@ -54,8 +55,8 @@ in virtualisation.oci-containers.backend = "podman"; - security.acme.acceptTerms = true; - security.acme.defaults.email = "admin@joshuabell.xyz"; + security.acme.acceptTerms = true; + security.acme.defaults.email = "admin@joshuabell.xyz"; services.nginx = { enable = true; recommendedGzipSettings = true; @@ -69,19 +70,13 @@ in }; }; + # forgejo http traffic "git.joshuabell.xyz" = { locations."/" = { proxyPass = "http://10.0.0.2:3000"; }; }; - # "git.joshuabell.xyz" = { - # # GIT passthrough - # locations."/" = { - # proxyPass = "http://10.0.0.2:3000"; - # }; - # }; - "_" = { default = true; locations."/" = { @@ -91,6 +86,7 @@ in }; # STREAMS + # Forgejo ssh streamConfig = '' server { listen 3032; diff --git a/hosts/h001/containers/homarr.nix b/hosts/h001/containers/homarr.nix new file mode 100644 index 0000000..29aa69e --- /dev/null +++ b/hosts/h001/containers/homarr.nix @@ -0,0 +1,47 @@ +{ + ... +}: +let + name = "homarr"; + hostDataDir = "/var/lib/${name}"; + + v_port = 7575; +in +{ + virtualisation.oci-containers.containers = { + "${name}" = { + image = "ghcr.io/homarr-labs/homarr:latest"; + ports = [ + "127.0.0.1:${toString v_port}:${toString v_port}" + ]; + volumes = [ + "${hostDataDir}:/appdata" + "/var/run/docker.sock:/var/run/docker.sock" + ]; + environment = { + SECRET_ENCRYPTION_KEY = "0b7e80116a742d16a8f07452a2d9b206b1997d32a6dd2c29cfe4df676e281295"; + }; + }; + }; + system.activationScripts."${name}_directories" = '' + mkdir -p ${hostDataDir} + chown -R root:root ${hostDataDir} + chmod -R 777 ${hostDataDir} + ''; + + services.nginx.virtualHosts = { + "100.64.0.13" = { + locations."/" = { + return = "301 http://h001.net.joshuabell.xyz"; + }; + }; + "h001.net.joshuabell.xyz" = { + locations = { + "/" = { + proxyWebsockets = true; + proxyPass = "http://127.0.0.1:${builtins.toString v_port}"; + }; + }; + }; + }; +} diff --git a/hosts/h001/containers/opengist.nix b/hosts/h001/containers/opengist.nix index 6a6dfb5..e529b94 100644 --- a/hosts/h001/containers/opengist.nix +++ b/hosts/h001/containers/opengist.nix @@ -9,7 +9,7 @@ let in { virtualisation.oci-containers.containers = { - opengist = { + "${name}" = { image = "ghcr.io/thomiceli/opengist:1"; ports = [ "127.0.0.1:${toString v_port}:${toString v_port}" diff --git a/hosts/h001/mods/adguardhome.nix b/hosts/h001/mods/adguardhome.nix index d6d7c71..314e469 100644 --- a/hosts/h001/mods/adguardhome.nix +++ b/hosts/h001/mods/adguardhome.nix @@ -14,6 +14,7 @@ 67 68 5543 + 3000 ]; networking.firewall.allowedUDPPorts = [ 53 @@ -24,29 +25,5 @@ 8853 5443 ]; - - # networking = { - # interfaces = { - # enp0s31f6 = { - # useDHCP = true; - # ipv4.addresses = [ - # { - # address = "10.12.14.2"; - # prefixLength = 24; - # } - # ]; - # }; - # }; - # }; - - services.nginx = { - virtualHosts = { - "h001.net.joshuabell.xyz" = { - locations."/" = { - proxyPass = "http://localhost:3000"; - }; - }; - }; - }; }; } diff --git a/hosts/h001/mods/nixarr.nix b/hosts/h001/mods/nixarr.nix index 7ff24a5..92dd4c0 100644 --- a/hosts/h001/mods/nixarr.nix +++ b/hosts/h001/mods/nixarr.nix @@ -45,60 +45,6 @@ proxyPass = "http://localhost:5055"; }; }; - "jellyfin.h001.n.joshuabell.xyz" = { - locations."/" = { - proxyWebsockets = true; - proxyPass = "http://localhost:8096"; - }; - }; - "media.h001.n.joshuabell.xyz" = { - locations."/" = { - proxyWebsockets = true; - proxyPass = "http://localhost:5055"; - }; - }; - "sabnzbd.h001.n.joshuabell.xyz" = { - locations."/" = { - proxyWebsockets = true; - proxyPass = "http://localhost:6336"; - }; - }; - "prowlarr.h001.n.joshuabell.xyz" = { - locations."/" = { - proxyWebsockets = true; - proxyPass = "http://localhost:9696"; - }; - }; - "radarr.h001.n.joshuabell.xyz" = { - locations."/" = { - proxyWebsockets = true; - proxyPass = "http://localhost:7878"; - }; - }; - "sonarr.h001.n.joshuabell.xyz" = { - locations."/" = { - proxyWebsockets = true; - proxyPass = "http://localhost:8989"; - }; - }; - "lidarr.h001.n.joshuabell.xyz" = { - locations."/" = { - proxyWebsockets = true; - proxyPass = "http://localhost:8686"; - }; - }; - "readarr.h001.n.joshuabell.xyz" = { - locations."/" = { - proxyWebsockets = true; - proxyPass = "http://localhost:8787"; - }; - }; - "bazarr.h001.n.joshuabell.xyz" = { - locations."/" = { - proxyWebsockets = true; - proxyPass = "http://localhost:6767"; - }; - }; }; }; };