2021-08-15 22:46:57 +00:00
|
|
|
# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
{ config, ... }:
|
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
../lib/bvm.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
# Networking!
|
|
|
|
networking = {
|
|
|
|
hostName = "bvm-netbox";
|
|
|
|
hostId = "e70e18a5";
|
|
|
|
|
|
|
|
interfaces.enp1s0 = {
|
|
|
|
ipv4.addresses = [{ address = "10.100.0.206"; prefixLength = 23; }];
|
|
|
|
};
|
2021-08-15 22:48:46 +00:00
|
|
|
interfaces.enp2s0 = {
|
2021-08-15 22:46:57 +00:00
|
|
|
ipv4.addresses = [{ address = "92.118.28.8"; prefixLength = 24; }];
|
|
|
|
ipv6.addresses = [{ address = "2a09:a441::8"; prefixLength = 32; }];
|
|
|
|
};
|
2021-08-15 22:48:46 +00:00
|
|
|
defaultGateway = { address = "92.118.28.1"; interface = "enp2s0"; };
|
|
|
|
defaultGateway6 = { address = "2a09:a441::1"; interface = "enp2s0"; };
|
2021-08-15 22:46:57 +00:00
|
|
|
};
|
2021-08-15 22:57:26 +00:00
|
|
|
my.ip.tailscale = "100.81.27.52";
|
2021-08-15 22:46:57 +00:00
|
|
|
|
2021-08-15 22:57:36 +00:00
|
|
|
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";
|
|
|
|
};
|
|
|
|
|
2021-08-15 22:46:57 +00:00
|
|
|
system.stateVersion = "21.05";
|
|
|
|
}
|