diff --git a/nixos/tailscale.nix b/nixos/tailscale.nix index e6ae0b4..d06da58 100644 --- a/nixos/tailscale.nix +++ b/nixos/tailscale.nix @@ -1 +1,16 @@ -{ services.tailscale = { enable = true; }; } +{ config, ... }: { + security.sudo.extraRules = [{ + users = [ config.var.username ]; + commands = [ + { + command = "/etc/profiles/per-user/${config.var.username}/bin/tailscale"; + options = [ "NOPASSWD" ]; + } + { + command = "/run/current-system/sw/bin/tailscale"; + options = [ "NOPASSWD" ]; + } + ]; + }]; + services.tailscale = { enable = true; }; +}