31 lines
723 B
Nix
31 lines
723 B
Nix
{ pkgs, config, lib, ... }:
|
|
|
|
let
|
|
cfg = config.modules.system.tailscale;
|
|
authkey_file = config.sops.secrets."tailscale_authkey".path;
|
|
in
|
|
{
|
|
options.modules.system.tailscale = {
|
|
enable = lib.mkEnableOption "enables tailscale";
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
services.tailscale = {
|
|
enable = true;
|
|
useRoutingFeatures = "both";
|
|
authKeyFile = authkey_file;
|
|
extraUpFlags = [
|
|
"--accept-routes=false" # true is equilivant to useRoutingFeatures = "client" (breaks shit)
|
|
"--accept-dns=true" # explicitly allow resolved
|
|
];
|
|
};
|
|
|
|
# declare authkey secrets
|
|
sops.secrets = {
|
|
"tailscale_authkey" = {
|
|
owner = "root";
|
|
};
|
|
};
|
|
};
|
|
}
|