nixos-config/machines/proxy/configuration.nix

118 lines
2.7 KiB
Nix
Raw Normal View History

{ self, caddy-with-plugins, ... }:
2024-02-05 11:46:52 +01:00
{ modulesPath, pkgs, ... }:
{
2022-01-24 11:14:34 +01:00
imports = [
(modulesPath + "/virtualisation/lxc-container.nix")
2022-01-24 11:14:34 +01:00
../../users/root
../../users/erwin
];
eboskma = {
2023-05-10 15:13:50 +02:00
users.erwin = {
enable = true;
server = true;
};
2022-08-07 11:24:24 +02:00
nix-common = {
enable = true;
2022-08-14 16:38:25 +02:00
remote-builders = true;
2022-08-07 11:24:24 +02:00
};
caddy-proxy = {
enable = true;
package = caddy-with-plugins.lib.caddyWithPackages {
inherit (pkgs) caddy buildGoModule;
plugins = [ "github.com/caddy-dns/cloudflare@74f004e1c1ab9056288f0baf3cd4b0039d6c77f3" ];
vendorHash = "sha256-UYNFkGK4A7DJSmin4nCo9rUD60gx80e9YZodn7uEcUM=";
};
proxyHosts = [
{
externalHostname = "home.datarift.nl";
proxyAddress = "homeassistant.barn-beaver.ts.net:8123";
external = true;
}
{
externalHostname = "frigate.datarift.nl";
proxyAddress = "frigate.barn-beaver.ts.net:5000";
}
{
externalHostname = "minio.datarift.nl";
proxyAddress = "minio.barn-beaver.ts.net:9000";
external = true;
}
{
externalHostname = "minio-admin.datarift.nl";
proxyAddress = "minio.barn-beaver.ts.net:9001";
}
{
externalHostname = "saga.datarift.nl";
proxyAddress = "saga.barn-beaver.ts.net:3000";
}
{
externalHostname = "unifi.datarift.nl";
proxyAddress = "unifi.barn-beaver.ts.net:8443";
}
];
};
tailscale.enable = true;
2022-01-24 11:14:34 +01:00
};
boot = {
isContainer = true;
kernel.sysctl = {
"net.core.rmem_max" = 2500000;
"net.core.wmem_max" = 2500000;
};
};
2022-01-24 11:14:34 +01:00
time.timeZone = "Europe/Amsterdam";
system.configurationRevision = self.inputs.nixpkgs.lib.mkIf (self ? rev) self.rev;
networking = {
hostName = "proxy";
useDHCP = false;
useHostResolvConf = false;
networkmanager.enable = false;
useNetworkd = true;
nftables.enable = true;
2023-05-23 17:12:31 +02:00
firewall.trustedInterfaces = [ "tailscale0" ];
};
2023-05-23 17:12:31 +02:00
systemd.network = {
enable = true;
2023-05-23 17:12:31 +02:00
wait-online.anyInterface = true;
networks = {
"40-eth0" = {
matchConfig = {
Name = "eth0";
};
2022-01-24 11:14:34 +01:00
networkConfig = {
Address = "10.0.0.251/24";
Gateway = "10.0.0.1";
DNS = "10.0.0.206";
DHCP = "no";
};
};
};
};
2022-01-24 11:14:34 +01:00
security = {
sudo-rs = {
enable = true;
execWheelOnly = true;
wheelNeedsPassword = false;
};
sudo.enable = false;
};
2023-01-31 17:00:01 +01:00
2022-01-24 11:14:34 +01:00
sops.defaultSopsFile = ./secrets.yaml;
sops.secrets = {
caddy-env = { };
};
2022-01-24 11:14:34 +01:00
system.stateVersion = "24.05";
2022-01-24 11:14:34 +01:00
}