Restructure to focus on nix.

This commit is contained in:
Lorenzo Good 2025-06-04 01:13:22 -05:00
parent 6952570818
commit 588fdbd9f2
Signed by: lorenzo
GPG key ID: 7FCD64BD81180ED0
19 changed files with 4 additions and 25 deletions

25
common/tailscale.nix Normal file
View file

@ -0,0 +1,25 @@
{
config,
lib,
...
}: let
inherit (lib) mkEnableOption mkOption types mkIf;
cfg = config.foehammer.tailscale;
in {
options.foehammer.tailscale = {
enable = mkEnableOption "Enable tailscale";
authKeyFile = mkOption {
type = types.nullOr types.path;
};
};
config = mkIf cfg.enable {
services.tailscale = {
enable = true;
authKeyFile = cfg.authKeyFile;
openFirewall = true;
};
networking.firewall.trustedInterfaces = ["tailscale0"];
};
}