nixos-config/machines/saga/configuration.nix

117 lines
2.3 KiB
Nix

{ self, ... }:
{
pkgs,
modulesPath,
lib,
config,
...
}:
{
imports = [
(modulesPath + "/virtualisation/lxc-container.nix")
../../users/root
../../users/erwin
./grafana
./loki
./prometheus
./promtail
];
eboskma = {
users.erwin = {
enable = true;
server = true;
};
caddy-proxy = {
enable = true;
package = pkgs.caddy.withPlugins {
plugins = [ "github.com/caddy-dns/cloudflare@89f16b99c18ef49c8bb470a82f895bce01cbaece" ];
hash = "sha256-JoujVXRXjKUam1Ej3/zKVvF0nX97dUizmISjy3M3Kr8=";
};
proxyHosts = [
{
externalHostname = "saga.datarift.nl";
proxyAddress = "localhost:3000";
}
];
};
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" ];
};
systemd = {
network = {
enable = true;
wait-online.anyInterface = true;
networks = {
"40-eth0" = {
matchConfig = {
Name = "eth0";
};
networkConfig = {
Address = "10.0.0.212/24";
Gateway = "10.0.0.1";
DNS = "10.0.0.206";
DHCP = "no";
};
};
};
};
services.logrotate-checkconf.enable = false;
};
security = {
sudo-rs = {
enable = true;
execWheelOnly = true;
wheelNeedsPassword = false;
};
sudo.enable = false;
};
sops.defaultSopsFile = ./secrets.yaml;
sops.secrets = {
caddy-env = { };
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;
};
grafana-oauth2-secret = {
owner = config.systemd.services.grafana.serviceConfig.User;
};
};
system.stateVersion = "24.05";
}