From ed029daaa4ec738950869612896e503a29896ebc Mon Sep 17 00:00:00 2001 From: catvayor Date: Sat, 2 Nov 2024 11:29:00 +0100 Subject: [PATCH] feat(netbox): netbox perso --- machines/kat-www/default.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/machines/kat-www/default.nix b/machines/kat-www/default.nix index 7eabcce..833f874 100644 --- a/machines/kat-www/default.nix +++ b/machines/kat-www/default.nix @@ -29,6 +29,7 @@ aliases = [ "www.katvayor.net" "katvayor.net" + "netbox.katvayor.net" ]; ip = "192.168.122.7"; }; @@ -68,10 +69,12 @@ security.acme = { acceptTerms = true; defaults.email = "root@katvayor.net"; + certs."website.katvayor.net".extraDomainNames = [ "netbox.katvayor.net" ]; }; services = { openssh.enable = true; qemuGuest.enable = true; + nginx = { enable = true; virtualHosts = { @@ -87,9 +90,29 @@ index = "index.html"; }; }; + "netbox.katvayor.net" = { + useACMEHost = "website.katvayor.net"; + addSSL = true; + locations = { + "/" = { + recommendedProxySettings = true; + proxyPass = "http://localhost:8001"; + }; + "/static/".alias = "${config.services.netbox.dataDir}/static/"; + }; + }; }; }; + + netbox = { + enable = true; + package = pkgs.netbox_4_1; + listenAddress = "127.0.0.1"; + secretKeyFile = "${config.services.netbox.dataDir}/secret.key"; + }; }; + users.users.nginx.extraGroups = [ "netbox" ]; + system.stateVersion = "23.11"; }