config-perso/machines/kat-www/default.nix

119 lines
2.4 KiB
Nix
Raw Normal View History

2024-10-28 11:15:27 +01:00
{
config,
lib,
pkgs,
...
}:
{
deployment = {
targetHost = "www.kat";
tags = [ "kat-vms" ];
};
imports = [
./hardware-configuration.nix
./disks.nix
];
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
kernelParams = [ "console=ttyS0" ];
};
kat = {
fqdn = "website.katvayor.net";
proxies = {
aliases = [
"www.katvayor.net"
"katvayor.net"
2024-11-02 11:29:00 +01:00
"netbox.katvayor.net"
2024-10-28 11:15:27 +01:00
];
ip = "192.168.122.7";
};
};
systemd.network.enable = lib.mkForce false;
networking = {
useNetworkd = lib.mkForce false;
interfaces."enp1s0" = {
useDHCP = false;
ipv4.addresses = [
{
address = "192.168.122.7";
prefixLength = 24;
}
];
ipv6.addresses = [
{
address = "fe80::7";
prefixLength = 64;
}
];
};
defaultGateway = "192.168.122.1";
defaultGateway6 = {
address = "fe80::1";
interface = "enp1s0";
};
nameservers = [
"192.168.122.1"
"fe80::1%enp1s0"
];
};
networking.firewall.enable = false;
security.acme = {
acceptTerms = true;
defaults.email = "root@katvayor.net";
2024-11-02 11:29:00 +01:00
certs."website.katvayor.net".extraDomainNames = [ "netbox.katvayor.net" ];
2024-10-28 11:15:27 +01:00
};
services = {
openssh.enable = true;
qemuGuest.enable = true;
2024-11-02 11:29:00 +01:00
2024-10-28 11:15:27 +01:00
nginx = {
enable = true;
virtualHosts = {
"website.katvayor.net" = {
serverAliases = [
"www.katvayor.net"
"katvayor.net"
];
enableACME = true;
addSSL = true;
locations."/" = {
alias = "/var/lib/www/";
index = "index.html";
};
};
2024-11-02 11:29:00 +01:00
"netbox.katvayor.net" = {
useACMEHost = "website.katvayor.net";
addSSL = true;
locations = {
"/" = {
recommendedProxySettings = true;
proxyPass = "http://localhost:8001";
};
"/static/".alias = "${config.services.netbox.dataDir}/static/";
};
};
2024-10-28 11:15:27 +01:00
};
};
2024-11-02 11:29:00 +01:00
netbox = {
enable = true;
package = pkgs.netbox_4_1;
listenAddress = "127.0.0.1";
secretKeyFile = "${config.services.netbox.dataDir}/secret.key";
};
2024-10-28 11:15:27 +01:00
};
2024-11-02 11:29:00 +01:00
users.users.nginx.extraGroups = [ "netbox" ];
2024-10-28 11:15:27 +01:00
system.stateVersion = "23.11";
}