nixos-config/machines/renge/services/netbox.nix

37 lines
866 B
Nix
Raw Permalink Normal View History

2023-08-12 13:59:03 +02:00
{ config, lib, pkgs, ... }:
2023-08-12 11:53:11 +02:00
{
sops.secrets.netbox-secret-key = {
sopsFile = ../secrets.yaml;
owner = "netbox";
};
services.netbox = {
enable = true;
package = pkgs.netbox;
secretKeyFile = config.sops.secrets.netbox-secret-key.path;
2023-08-12 13:59:03 +02:00
plugins = ps: with ps; [
netbox-inventory
netbox-topology-views
];
settings = {
PLUGINS = [
"netbox_inventory"
"netbox_topology_views"
];
};
2023-08-12 11:53:11 +02:00
};
services.nginx.virtualHosts."netbox.sbruder.de" = {
enableACME = true;
forceSSL = true;
locations = {
"/".proxyPass = with config.services.netbox; "http://${listenAddress}:${toString port}";
"/static/".alias = "${config.services.netbox.dataDir}/static/";
};
};
# allow nginx access to static
users.groups."${config.users.users.netbox.name}".members = [ "nginx" ];
}