diff --git a/ops/nixos/bvm-netbox/default.nix b/ops/nixos/bvm-netbox/default.nix index 5f6be657e0..6443121948 100644 --- a/ops/nixos/bvm-netbox/default.nix +++ b/ops/nixos/bvm-netbox/default.nix @@ -25,5 +25,29 @@ }; my.ip.tailscale = "100.81.27.52"; + services.postgresql = { + enable = true; + ensureDatabases = [ + "netbox" + ]; + ensureUsers = [{ + name = "netbox"; + ensurePermissions = { "DATABASE netbox" = "ALL PRIVILEGES"; }; + }]; + }; + services.postgresqlBackup.enable = true; + + services.redis = { + enable = true; + }; + + users.groups.netbox = {}; + users.users.netbox = { + home = "/srv/netbox"; + isSystemUser = true; + createHome = true; + group = "netbox"; + }; + system.stateVersion = "21.05"; }