From dbd0c993b3fc19e12d9f7b92a27439bf858df84b Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 10 Dec 2024 00:10:36 +0000 Subject: [PATCH] Add nginx vhosts for self-hosted services --- nix/hosts/lemp11/default.nix | 3 +++ nix/hosts/lemp11/modules/nginx.nix | 12 ++++++++++++ .../features/homelab/tubearchivist-container.nix | 2 +- todo.txt | 1 - 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 nix/hosts/lemp11/modules/nginx.nix diff --git a/nix/hosts/lemp11/default.nix b/nix/hosts/lemp11/default.nix index 9b7223c..bef11fd 100644 --- a/nix/hosts/lemp11/default.nix +++ b/nix/hosts/lemp11/default.nix @@ -21,7 +21,10 @@ imports = [ inputs.agenix.nixosModules.default + ./configuration.nix ./secrets.nix + + ./modules/nginx.nix ]; } diff --git a/nix/hosts/lemp11/modules/nginx.nix b/nix/hosts/lemp11/modules/nginx.nix new file mode 100644 index 0000000..35d314e --- /dev/null +++ b/nix/hosts/lemp11/modules/nginx.nix @@ -0,0 +1,12 @@ +{ + services.nginx = { + enable = true; + + virtualHosts = { + "gitea.localhost".locations."/".proxyPass = "http://localhost:2222/"; + "immich.localhost".locations."/".proxyPass = "http://localhost:2283/"; + "jellyfin.localhost".locations."/".proxyPass = "http://localhost:8096/"; + "tubearchivist.localhost".locations."/".proxyPass = "http://localhost:8000/"; + }; + }; +} diff --git a/nix/modules/nixos/features/homelab/tubearchivist-container.nix b/nix/modules/nixos/features/homelab/tubearchivist-container.nix index f8c1f51..d944dc7 100644 --- a/nix/modules/nixos/features/homelab/tubearchivist-container.nix +++ b/nix/modules/nixos/features/homelab/tubearchivist-container.nix @@ -132,7 +132,7 @@ in "HOST_GID" = "1000"; "HOST_UID" = "1000"; "REDIS_HOST" = "archivist-redis"; - "TA_HOST" = "tubearchivist.local"; + "TA_HOST" = "tubearchivist.localhost"; "TZ" = "Europe/London"; }; diff --git a/todo.txt b/todo.txt index 01f179a..4aa064b 100644 --- a/todo.txt +++ b/todo.txt @@ -1,5 +1,4 @@ Use nixosModules and homeManagerModules outputs in flake.nix to simplify importing modules -Use nginx for jellyfin, immich and gitea Add daily script Add create-podcast-tasks script Add vaultwarden for password management