From a67d3353e22d50170b1a526479b013a68a4a0ece Mon Sep 17 00:00:00 2001 From: uttarayan21 Date: Sun, 4 May 2025 04:34:14 +0530 Subject: [PATCH] feat: Added tailscale steam deck module --- modules/home/tailscale.nix | 28 ++++++++++++++++++++++++++++ steamdeck/tailscale.nix | 11 +++-------- 2 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 modules/home/tailscale.nix 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; }