122 lines
2.8 KiB
Nix
122 lines
2.8 KiB
Nix
{ self, caddy-with-plugins, ... }:
|
|
{ modulesPath, pkgs, ... }:
|
|
{
|
|
imports = [
|
|
(modulesPath + "/virtualisation/lxc-container.nix")
|
|
../../users/root
|
|
../../users/erwin
|
|
];
|
|
|
|
eboskma = {
|
|
users.erwin = {
|
|
enable = true;
|
|
server = true;
|
|
};
|
|
nix-common = {
|
|
enable = true;
|
|
remote-builders = true;
|
|
};
|
|
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 = "git.datarift.nl";
|
|
proxyAddress = "gitea.barn-beaver.ts.net:3000";
|
|
external = true;
|
|
}
|
|
{
|
|
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;
|
|
};
|
|
|
|
boot = {
|
|
isContainer = true;
|
|
kernel.sysctl = {
|
|
"net.core.rmem_max" = 2500000;
|
|
"net.core.wmem_max" = 2500000;
|
|
};
|
|
};
|
|
|
|
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;
|
|
|
|
firewall.trustedInterfaces = [ "tailscale0" ];
|
|
};
|
|
|
|
systemd.network = {
|
|
enable = true;
|
|
|
|
wait-online.anyInterface = true;
|
|
|
|
networks = {
|
|
"40-eth0" = {
|
|
matchConfig = {
|
|
Name = "eth0";
|
|
};
|
|
|
|
networkConfig = {
|
|
Address = "10.0.0.251/24";
|
|
Gateway = "10.0.0.1";
|
|
DNS = "10.0.0.206";
|
|
DHCP = "no";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
security = {
|
|
sudo-rs = {
|
|
enable = true;
|
|
execWheelOnly = true;
|
|
wheelNeedsPassword = false;
|
|
};
|
|
sudo.enable = false;
|
|
};
|
|
|
|
sops.defaultSopsFile = ./secrets.yaml;
|
|
sops.secrets = {
|
|
caddy-env = { };
|
|
};
|
|
|
|
system.stateVersion = "24.05";
|
|
}
|