From 67beb737c2d1de44b871180ab210f5d0ce684d1d Mon Sep 17 00:00:00 2001
From: matt1432 <matt@nelim.org>
Date: Tue, 22 Apr 2025 21:00:08 -0400
Subject: [PATCH] fix(homie): fix restarting spotify in temp-fix-nic

---
 configurations/homie/default.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configurations/homie/default.nix b/configurations/homie/default.nix
index 064a8935..ef792300 100644
--- a/configurations/homie/default.nix
+++ b/configurations/homie/default.nix
@@ -47,7 +47,7 @@
   systemd.services."temp-fix-nic" = {
     wantedBy = ["multi-user.target"];
     after = ["tailscaled.service"];
-    path = [pkgs.ripgrep "/run/wrappers"];
+    path = [pkgs.ripgrep pkgs.systemd "/run/wrappers"];
     script = ''
       # Wait for boot to finish
       sleep 60
@@ -58,7 +58,7 @@
           if echo "$line" | rg 'NIC Link is Up' &> /dev/null; then
               echo "restarting tailscaled"
               systemctl restart tailscaled.service
-              sudo -u ${mainUser} systemctl --user restart spotifyd
+              machinectl shell ${mainUser}@ ${pkgs.systemd}/bin/systemctl --user restart spotifyd
           fi
       done
     '';