2024-06-10 10:59:31 +02:00
|
|
|
{ self, caddy-with-plugins, ... }:
|
2024-02-29 14:21:15 +01:00
|
|
|
{
|
2024-06-10 10:59:31 +02:00
|
|
|
pkgs,
|
2024-02-29 14:21:15 +01:00
|
|
|
modulesPath,
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}:
|
2024-02-28 22:49:27 +01:00
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
(modulesPath + "/virtualisation/lxc-container.nix")
|
|
|
|
../../users/root
|
|
|
|
../../users/erwin
|
|
|
|
|
|
|
|
./grafana
|
2024-04-26 11:28:35 +02:00
|
|
|
./loki
|
2024-02-28 22:49:27 +01:00
|
|
|
./prometheus
|
2024-04-26 11:28:35 +02:00
|
|
|
./promtail
|
2024-02-28 22:49:27 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
eboskma = {
|
|
|
|
users.erwin = {
|
|
|
|
enable = true;
|
|
|
|
server = true;
|
|
|
|
};
|
2024-06-10 10:59:31 +02:00
|
|
|
caddy-proxy = {
|
|
|
|
enable = true;
|
|
|
|
package = caddy-with-plugins.packages.${pkgs.system}.caddy-with-cloudflare;
|
|
|
|
proxyHosts = [
|
|
|
|
{
|
|
|
|
externalHostname = "saga.datarift.nl";
|
|
|
|
proxyAddress = "localhost:3000";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2024-02-28 22:49:27 +01:00
|
|
|
nix-common = {
|
|
|
|
enable = true;
|
|
|
|
remote-builders = true;
|
|
|
|
};
|
|
|
|
tailscale.enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
boot = {
|
|
|
|
isContainer = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
time.timeZone = "Europe/Amsterdam";
|
|
|
|
|
|
|
|
system.configurationRevision = lib.mkIf (self ? rev) self.rev;
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
hostName = "saga";
|
|
|
|
useDHCP = false;
|
|
|
|
useHostResolvConf = false;
|
|
|
|
networkmanager.enable = false;
|
|
|
|
useNetworkd = true;
|
|
|
|
nftables.enable = true;
|
|
|
|
|
|
|
|
firewall.trustedInterfaces = [ "tailscale0" ];
|
|
|
|
};
|
|
|
|
|
2024-06-10 10:59:31 +02:00
|
|
|
systemd = {
|
|
|
|
network = {
|
|
|
|
enable = true;
|
2024-02-28 22:49:27 +01:00
|
|
|
|
2024-06-10 10:59:31 +02:00
|
|
|
wait-online.anyInterface = true;
|
2024-02-28 22:49:27 +01:00
|
|
|
|
2024-06-10 10:59:31 +02:00
|
|
|
networks = {
|
|
|
|
"40-eth0" = {
|
|
|
|
matchConfig = {
|
|
|
|
Name = "eth0";
|
|
|
|
};
|
2024-02-28 22:49:27 +01:00
|
|
|
|
2024-06-10 10:59:31 +02:00
|
|
|
networkConfig = {
|
|
|
|
Address = "10.0.0.212/24";
|
|
|
|
Gateway = "10.0.0.1";
|
|
|
|
DNS = "10.0.0.206";
|
|
|
|
DHCP = "no";
|
|
|
|
};
|
2024-02-28 22:49:27 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-06-10 10:59:31 +02:00
|
|
|
|
|
|
|
services.logrotate-checkconf.enable = false;
|
2024-02-28 22:49:27 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
security = {
|
|
|
|
sudo-rs = {
|
|
|
|
enable = true;
|
|
|
|
execWheelOnly = true;
|
|
|
|
wheelNeedsPassword = false;
|
|
|
|
};
|
|
|
|
sudo.enable = false;
|
|
|
|
};
|
|
|
|
|
2024-02-29 14:21:15 +01:00
|
|
|
sops.defaultSopsFile = ./secrets.yaml;
|
|
|
|
sops.secrets = {
|
2024-06-10 10:59:31 +02:00
|
|
|
caddy-env = { };
|
2024-02-29 14:21:15 +01:00
|
|
|
metrics_ca = {
|
|
|
|
owner = config.systemd.services.prometheus.serviceConfig.User;
|
|
|
|
};
|
|
|
|
metrics_cert = {
|
|
|
|
owner = config.systemd.services.prometheus.serviceConfig.User;
|
|
|
|
};
|
|
|
|
metrics_key = {
|
|
|
|
owner = config.systemd.services.prometheus.serviceConfig.User;
|
|
|
|
};
|
2024-02-29 23:14:56 +01:00
|
|
|
grafana-oauth2-secret = {
|
|
|
|
owner = config.systemd.services.grafana.serviceConfig.User;
|
|
|
|
};
|
2024-02-29 14:21:15 +01:00
|
|
|
};
|
2024-02-28 22:49:27 +01:00
|
|
|
|
|
|
|
system.stateVersion = "24.05";
|
|
|
|
}
|