dotfiles/nixos/tailscale/default.nix
Cyryl Płotnicki cd981587a6
Some checks failed
use nix / build (push) Failing after 3m58s
fix tailscale boot
2024-06-13 13:15:58 +01:00

32 lines
761 B
Nix

{
config,
pkgs,
inputs,
system,
...
}: let
inherit
(inputs.nixpkgs-nixos-unstable.legacyPackages."${system}")
tailscale
;
in {
environment.systemPackages = [tailscale];
services.tailscale = {
enable = true;
package = tailscale;
authKeyFile = "/run/secrets/tailscale-key-${config.networking.hostName}";
extraUpFlags = ["--stateful-filtering"];
};
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"];
};
}