Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
Hadi
2025-07-16 19:25:32 +02:00
parent f74e15288b
commit 18c8afb616
18 changed files with 150 additions and 147 deletions

View File

@@ -1,25 +1,31 @@
# Tailscale is a VPN service that makes it easy to connect your devices between each other.
{ 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" ];
}
];
}];
{config, ...}: let
username = config.var.username;
in {
security.sudo.extraRules = [
{
users = [username];
# Allow running Tailscale commands without a password
commands = [
{
command = "/etc/profiles/per-user/${username}/bin/tailscale";
options = ["NOPASSWD"];
}
{
command = "/run/current-system/sw/bin/tailscale";
options = ["NOPASSWD"];
}
];
}
];
services.tailscale = {
enable = true;
openFirewall = true;
};
networking.firewall = {
trustedInterfaces = [ "tailscale0" ];
trustedInterfaces = ["tailscale0"];
# required to connect to Tailscale exit nodes
checkReversePath = "loose";
};