diff --git a/modules/home/tailscale.nix b/modules/home/tailscale.nix new file mode 100644 index 00000000..23b56947 --- /dev/null +++ b/modules/home/tailscale.nix @@ -0,0 +1,28 @@ +{ + pkgs, + config, + lib, + ... +}: +with lib; let + cfg = config.services.aichat; +in { + options = { + services.aichat = { + enable = mkEnableOption "aichat"; + package = mkPackageOption pkgs "aichat" {}; + }; + }; + + config = { + home.packages = mkIf cfg.enable [cfg.package]; + home.activation.runTailscaleActivation = let + tailscaleLib = "${cfg.package}/lib"; + in + lib.hm.dag.entryAfter ["writeBoundary"] '' + cp -r ${tailscaleLib} /etc/ + systemctl reload-daemon + systemctl enable --now tailscaled + ''; + }; +} diff --git a/steamdeck/tailscale.nix b/steamdeck/tailscale.nix index 8683b593..06470dbd 100644 --- a/steamdeck/tailscale.nix +++ b/steamdeck/tailscale.nix @@ -3,13 +3,8 @@ config, ... }: { - home.packages = [ - (pkgs.tailscale.overrideAttrs (old: { - postInstall = - old.postInstall - + '' - cp -r $out/lib $out/etc - ''; - })) + imports = [ + ../modules/home/tailscale.nix ]; + services.tailscale.enable = true; }