diff --git a/hosts/fred/default.nix b/hosts/fred/default.nix index 82cc0bb..f1aed8c 100644 --- a/hosts/fred/default.nix +++ b/hosts/fred/default.nix @@ -14,6 +14,7 @@ ../themes.nix ./podman.nix ../server/searxng.nix + ../server/unifi.nix ]; networking.hostName = "fred"; boot.binfmt.emulatedSystems = ["aarch64-linux"]; diff --git a/hosts/server/unifi.nix b/hosts/server/unifi.nix new file mode 100644 index 0000000..e246188 --- /dev/null +++ b/hosts/server/unifi.nix @@ -0,0 +1,30 @@ +{ + pkgs, + config, + ... +}: { + + nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ + "unifi-controller" + ]; + services = { + unifi = { + enable = true; + unifiPackage = pkgs.unifi8; + openFirewall = true; + }; + nginx = { + enable = true; + recommendedProxySettings = true; + + virtualHosts."unifi.local" = { + # forceSSL = true; + # useACMEHost = "unifi.local"; + locations."/" = { + proxyPass = "https://127.0.0.1:8443"; + proxyWebsockets = true; + }; + }; + }; + }; +}