NixOS-Configs/hosts/server/unifi.nix
2024-10-05 12:39:26 -05:00

30 lines
584 B
Nix

{
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;
};
};
};
};
}