2023-08-10 16:43:46 +02:00
|
|
|
{ self, caddy-with-plugins, ... }:
|
2024-02-05 11:46:52 +01:00
|
|
|
{ modulesPath, pkgs, ... }:
|
|
|
|
{
|
2022-01-24 11:14:34 +01:00
|
|
|
imports = [
|
2024-01-02 22:01:55 +01:00
|
|
|
(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
|
|
|
};
|
2023-08-10 16:43:46 +02:00
|
|
|
caddy-proxy = {
|
|
|
|
enable = true;
|
|
|
|
package = caddy-with-plugins.lib.caddyWithPackages {
|
|
|
|
inherit (pkgs) caddy buildGoModule;
|
|
|
|
plugins = [ "github.com/caddy-dns/cloudflare@74f004e1c1ab9056288f0baf3cd4b0039d6c77f3" ];
|
2024-01-22 20:29:55 +01:00
|
|
|
vendorHash = "sha256-UYNFkGK4A7DJSmin4nCo9rUD60gx80e9YZodn7uEcUM=";
|
2023-08-10 16:43:46 +02:00
|
|
|
};
|
|
|
|
};
|
2024-01-02 22:01:55 +01:00
|
|
|
tailscale.enable = true;
|
2022-01-24 11:14:34 +01:00
|
|
|
};
|
|
|
|
|
2024-01-02 22:01:55 +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;
|
|
|
|
|
2024-01-02 22:01:55 +01:00
|
|
|
networking = {
|
|
|
|
hostName = "proxy";
|
|
|
|
useDHCP = false;
|
|
|
|
useHostResolvConf = false;
|
|
|
|
networkmanager.enable = false;
|
|
|
|
useNetworkd = true;
|
|
|
|
nftables.enable = true;
|
2023-05-23 17:12:31 +02:00
|
|
|
|
2024-01-02 22:01:55 +01:00
|
|
|
firewall.trustedInterfaces = [ "tailscale0" ];
|
|
|
|
};
|
2023-05-23 17:12:31 +02:00
|
|
|
|
2024-01-02 22:01:55 +01:00
|
|
|
systemd.network = {
|
|
|
|
enable = true;
|
2023-05-23 17:12:31 +02:00
|
|
|
|
2024-01-29 10:27:21 +01:00
|
|
|
wait-online.anyInterface = true;
|
|
|
|
|
2024-01-02 22:01:55 +01:00
|
|
|
networks = {
|
|
|
|
"40-eth0" = {
|
|
|
|
matchConfig = {
|
|
|
|
Name = "eth0";
|
|
|
|
};
|
2022-01-24 11:14:34 +01:00
|
|
|
|
2024-01-02 22:01:55 +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
|
|
|
|
2024-01-02 22:01:55 +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;
|
2023-08-10 16:43:46 +02:00
|
|
|
sops.secrets = {
|
|
|
|
caddy-env = { };
|
|
|
|
};
|
2022-01-24 11:14:34 +01:00
|
|
|
|
2024-01-02 22:01:55 +01:00
|
|
|
system.stateVersion = "24.05";
|
2022-01-24 11:14:34 +01:00
|
|
|
}
|