dotfiles/nixos/tailscale/default.nix
Cyryl Płotnicki db580ad606 Migrate to new tailscale config
* use the new config option isntead of custom service
* lower the log spam
2023-12-08 17:52:51 +00:00

30 lines
709 B
Nix

{
config,
pkgs,
inputs,
...
}: let
inherit
(inputs.nixpkgs-nixos-unstable.legacyPackages."x86_64-linux")
tailscale
;
in {
environment.systemPackages = [tailscale];
services.tailscale = {
enable = true;
package = tailscale;
authKeyFile = "/run/secrets/tailscale-key-${config.networking.hostName}";
};
systemd.services.tailscaled = {
serviceConfig.LogLevelMax = "notice";
};
networking.firewall = {
trustedInterfaces = ["tailscale0"];
allowedUDPPorts = [config.services.tailscale.port];
};
sops.secrets."tailscale-key-${config.networking.hostName}" = {
sopsFile = ./keys.sops.yaml;
restartUnits = ["tailscaled-autoconnect.service"];
};
}