Add netbox service to curiosity

This commit is contained in:
Théo Barnouin 2024-09-24 16:05:59 +02:00
parent aa5924e620
commit 46ac6032ae
2 changed files with 56 additions and 35 deletions

View file

@ -88,10 +88,10 @@
{ {
microvm = { microvm = {
autostart = [ autostart = [
"jellyfin" "netbox"
]; ];
vms = { vms = {
jellyfin = { netbox = {
flake = self; flake = self;
updateFlake = "git+file:///etc/nixos"; updateFlake = "git+file:///etc/nixos";
}; };
@ -188,6 +188,27 @@
} }
]; ];
}; };
netbox = nixpkgs.lib.nixosSystem {
inherit system;
modules = [
microvm.nixosModules.microvm
"${inputs.self}/systems"
"${inputs.self}/services"
{
services.vm_netbox = {
enable = true;
};
services.vm = {
enable = true;
hostname = "netbox";
vm_ip = "192.168.1.45";
vm_cpu = 2;
vm_mem = 2048;
macAddr = "02:00:00:00:00:45";
};
}
];
};
authentik = nixpkgs.lib.nixosSystem { authentik = nixpkgs.lib.nixosSystem {
inherit system; inherit system;
modules = [ modules = [

View file

@ -15,40 +15,40 @@ in
enable = true; enable = true;
port = 8001; port = 8001;
settings = { settings = {
ALLOWED_HOSTS = [ "*" ], ALLOWED_HOSTS = [ "*" ];
DATABASE = { DATABASE = lib.mkForce {
'ENGINE': 'django.db.backends.postgresql', ENGINE = "django.db.backends.postgresql";
'NAME': 'netbox', NAME = "netbox";
'USER': 'netbox', USER = "netbox";
'PASSWORD': 'Netbox43Zer!', PASSWORD = "Netbox43Zer!";
'HOST': '192.168.1.13', HOST = "192.168.1.13";
'PORT': '5432', PORT = 5432;
'CONN_MAX_AGE': 300, CONN_MAX_AGE = 300;
}, };
REDIS = { REDIS = {
'tasks': { tasks = {
'HOST': '192.168.1.16', HOST = "192.168.1.16";
'PORT': 6379, PORT = 6379;
'USERNAME': '', USERNAME = "";
'PASSWORD': '', PASSWORD = "";
'DATABASE': 0, DATABASE = 0;
'SSL': False, SSL = false;
}, };
'caching': { caching = {
'HOST': '192.168.1.16', HOST = "192.168.1.16";
'PORT': 6379, PORT = 6379;
'USERNAME': '', USERNAME = "";
'PASSWORD': '', PASSWORD = "";
'DATABASE': 1, DATABASE = 1;
'SSL': False, SSL = false;
} };
}, };
CSRF_COOKIE_NAME = 'csrftoken', CSRF_COOKIE_NAME = "csrftoken";
CSRF_TRUSTED_ORIGINS = ( CSRF_TRUSTED_ORIGINS = [
'http://192.168.1.40', "http://192.168.1.40"
'https://netbox.le43.eu', "https://netbox.le43.eu"
), ];
DEBUG = False DEBUG = false;
}; };
secretKeyFile = "/run/secrets/netbox/keyFile"; secretKeyFile = "/run/secrets/netbox/keyFile";
}; };