From 172a6124be22dbef6aa0c56cdbfa68f1ecdfe0d0 Mon Sep 17 00:00:00 2001 From: Elias Almqvist Date: Thu, 25 Jul 2024 17:21:31 -0700 Subject: [PATCH] fix nix daemon autostart --- nix-darwin/services/nix-daemon.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nix-darwin/services/nix-daemon.nix b/nix-darwin/services/nix-daemon.nix index 561d24e..9c8f2bb 100644 --- a/nix-darwin/services/nix-daemon.nix +++ b/nix-darwin/services/nix-daemon.nix @@ -1,5 +1,8 @@ -{ config, pkgs, scriptPath ? "/opt/nix-daemon.sh", ... }: +{ config, pkgs, ... }: +let + fullScriptPath = "/opt/nix-daemon.sh"; +in { home.file."Library/LaunchAgents/org.nixos.autostart.plist" = { text = '' @@ -12,7 +15,7 @@ ProgramArguments ${pkgs.bash}/bin/bash - ${scriptPath} + ${fullScriptPath} RunAtLoad @@ -23,7 +26,7 @@ ''; }; - home.file."${scriptPath}" = { + home.file."${fullScriptPath}" = { text = '' if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'