netbox yolo
This commit is contained in:
parent
3df1ec0436
commit
5a28a55f01
2 changed files with 47 additions and 0 deletions
|
@ -21,6 +21,7 @@
|
|||
../../services/lantifa.nix
|
||||
../../services/vaultwarden.nix
|
||||
../../services/uffd.nix
|
||||
../../services/netbox.nix
|
||||
|
||||
./lxc.nix
|
||||
];
|
||||
|
|
46
services/netbox.nix
Normal file
46
services/netbox.nix
Normal file
|
@ -0,0 +1,46 @@
|
|||
{ 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";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue