feat(tailscale): set ts auth key to auto connect

This commit is contained in:
Mohammad Rafiq 2025-03-27 05:07:23 +08:00
parent 56edf9e312
commit 1709e1ed56
No known key found for this signature in database
2 changed files with 11 additions and 2 deletions

View file

@ -1,4 +1,9 @@
{ hostname, lib, ... }: {
hostname,
lib,
config,
...
}:
{ {
networking = { networking = {
hostName = hostname; hostName = hostname;
@ -28,5 +33,8 @@
interfaces.enp12s0.wakeOnLan.enable = true; interfaces.enp12s0.wakeOnLan.enable = true;
}; };
services.openssh.enable = true; services.openssh.enable = true;
services.tailscale.enable = true; services.tailscale = {
enable = true;
authKeyFile = config.sops.secrets.ts_auth_key.path;
};
} }

View file

@ -8,6 +8,7 @@
defaultSopsFile = ./secrets/secrets.yaml; defaultSopsFile = ./secrets/secrets.yaml;
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
secrets.password.neededForUsers = true; secrets.password.neededForUsers = true;
secrets.ts_auth_key = { };
}; };
security.sudo.wheelNeedsPassword = false; security.sudo.wheelNeedsPassword = false;