From 13dedfa654bf9d47374012a47bc933ddb32d38cf Mon Sep 17 00:00:00 2001 From: uttarayan21 Date: Sun, 4 May 2025 05:53:14 +0530 Subject: [PATCH] feat: Added stuff from steamdeck Signed-off-by: uttarayan21 --- Makefile | 4 ++++ modules/home/tailscale.nix | 22 +++++++++++----------- steamdeck/tailscale.nix | 8 +++++++- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 62e49687..13410f52 100644 --- a/Makefile +++ b/Makefile @@ -22,5 +22,9 @@ home: nixos: sudo nixos-rebuild switch --flake . +deck: + nix run home-manager/master -- switch --flake .#deck + + test_nixos: sudo nixos-rebuild test --fast --flake . diff --git a/modules/home/tailscale.nix b/modules/home/tailscale.nix index 23b56947..d79b2984 100644 --- a/modules/home/tailscale.nix +++ b/modules/home/tailscale.nix @@ -5,24 +5,24 @@ ... }: with lib; let - cfg = config.services.aichat; + cfg = config.services.tailscale; in { options = { - services.aichat = { - enable = mkEnableOption "aichat"; - package = mkPackageOption pkgs "aichat" {}; + services.tailscale = { + enable = mkEnableOption "tailscale"; + package = mkPackageOption pkgs "tailscale" {}; }; }; config = { home.packages = mkIf cfg.enable [cfg.package]; - home.activation.runTailscaleActivation = let - tailscaleLib = "${cfg.package}/lib"; + # This doesn't work since we don't have root + home.activation.copyTailscaledService = mkIf cfg.enable (let + tailscaleService = "${cfg.package}/lib/systemd/system/tailscaled.service"; in - lib.hm.dag.entryAfter ["writeBoundary"] '' - cp -r ${tailscaleLib} /etc/ - systemctl reload-daemon - systemctl enable --now tailscaled - ''; + lib.hm.dag.entryAfter ["installPackages"] '' + verboseEcho Copying the tailscale systemd files to /etc + run cp ${tailscaleService} /etc/systemd/system/tailscaled.service + ''); }; } diff --git a/steamdeck/tailscale.nix b/steamdeck/tailscale.nix index 06470dbd..9de09f10 100644 --- a/steamdeck/tailscale.nix +++ b/steamdeck/tailscale.nix @@ -6,5 +6,11 @@ imports = [ ../modules/home/tailscale.nix ]; - services.tailscale.enable = true; + services.tailscale = { + enable = false; + }; + + home.packages = [ + pkgs.tailscale + ]; }