haccfiles/services/netbox.nix

47 lines
1.1 KiB
Nix
Raw Normal View History

2022-12-08 22:30:02 +00:00
{ config, lib, pkgs, evalConfig, ... }:
{
containers.netbox = {
privateNetwork = true;
hostAddress = "192.168.140.1";
localAddress = "192.168.140.10";
autoStart = true;
path = (evalConfig {
hosts = { };
groups = { };
} ({ config, lib, pkgs, profiles, modules, sources, ... }: {
boot.isContainer = true;
networking.useDHCP = false;
users.users.root.hashedPassword = "";
system.stateVersion = "21.11";
imports = [ sources.nix-hexchen.nixosModules.profiles.nopersist ];
services.netbox = {
enable = true;
secretKeyFile = "/var/lib/netbox/secret";
listenAddress = "0.0.0.0";
};
services.coredns = {
enable = true;
config = ''
.:53 {
forward . 1.1.1.1
}
'';
};
})).config.system.build.toplevel;
};
services.nginx.virtualHosts."netbox.infra4future.de" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://${config.containers.netbox.localAddress}:8001";
};
};
}