Update containers
This commit is contained in:
parent
ee9c452083
commit
98ab0aa25e
2 changed files with 8 additions and 39 deletions
|
@ -3,23 +3,17 @@
|
|||
./${hostname}
|
||||
../users/${username}
|
||||
../common/modules/nixos.nix
|
||||
../common/modules/networking.nix
|
||||
# ,../common/modules/networking.nix
|
||||
# Services
|
||||
../common/services/promtail.nix
|
||||
../common/services/telegraf.nix
|
||||
../common/services/tailscale.nix
|
||||
../common/services/openssh.nix
|
||||
];
|
||||
|
||||
boot.isContainer = true;
|
||||
networking.hostName = "${hostname}";
|
||||
system.stateVersion = stateVersion;
|
||||
|
||||
# Workaround for bug https://github.com/NixOS/nixpkgs/issues/162686
|
||||
# networking.useHostResolvConf = lib.mkForce false;
|
||||
# services.resolved.enable = true;
|
||||
|
||||
networking.defaultGateway = "192.168.2.1";
|
||||
networking.hostName = "${hostname}";
|
||||
|
||||
# Set up the secrets file:
|
||||
sops.secrets."tailscale_key" = {
|
||||
|
@ -31,30 +25,7 @@
|
|||
];
|
||||
};
|
||||
|
||||
services.tailscale.enable = true;
|
||||
services.tailscale.authKeyFile = "/run/secrets/tailscale_key";
|
||||
systemd.services.tailscaled.enable = lib.mkForce false;
|
||||
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
interfaceName = "tailscale0-${hostname}";
|
||||
extraUpFlags = [
|
||||
"--login-server=https://headscale.sysctl.io"
|
||||
"--accept-dns"
|
||||
"--accept-routes"
|
||||
];
|
||||
};
|
||||
|
||||
systemd.services = {
|
||||
"tailscaled-custom" = {
|
||||
enable = true;
|
||||
path = [ pkgs.tailscale ];
|
||||
script = ''tailscaled -no-logs-no-support -tun=userspace'';
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "tailscaled-autoconnect.service" ];
|
||||
serviceConfig.Restart = "on-failure";
|
||||
serviceConfig.Type = "oneshot";
|
||||
serviceConfig.User = "root";
|
||||
serviceConfig.Group = "wheel";
|
||||
};
|
||||
};
|
||||
services.tailscale.interfaceName = "userspace-networking";
|
||||
}
|
||||
|
|
|
@ -8,11 +8,9 @@ in {
|
|||
};
|
||||
|
||||
networking = {
|
||||
networkmanager.unmanaged = [ "interface-name:ve-*" ];
|
||||
nat = {
|
||||
enable = true;
|
||||
externalInterface = lanInterface;
|
||||
internalInterfaces = [ "ve-+" ];
|
||||
};
|
||||
nat.enable = true;
|
||||
nat.internalInterfaces = [ "ve-+" ];
|
||||
nat.externalInterface = lanInterface;
|
||||
firewall.extraCommands = ''iptables -t nat -A POSTROUTING -o ${lanInterface} -j MASQUERADE'';
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue