infrastructure/external/netbox/default.nix

29 lines
874 B
Nix
Raw Normal View History

{ pkgs, lib, config, ... }:
{
imports = [
./secrets
];
services.netbox = {
enable = true;
secretKeyFile = config.age.secrets."netbox".path;
listenAddress = "127.0.0.1";
settings = {
ALLOWED_HOSTS = [ "netbox.dgnum.sinavir.fr" ];
};
};
# my server is slow sorry
systemd.services.netbox.serviceConfig.TimeoutStartSec = 600;
services.nginx = {
enable = true;
virtualHosts."netbox.dgnum.sinavir.fr" = {
enableACME = true;
forceSSL = true;
locations."/".proxyPass = "http://${config.services.netbox.listenAddress}:${builtins.toString config.services.netbox.port}";
locations."/static/".alias = "${config.services.netbox.dataDir}/static/";
};
};
users.users.nginx.extraGroups = ["netbox"];
networking.firewall.allowedTCPPorts = [ 443 80 ];
services.postgresql.package = pkgs.postgresql_14;
}