From b6f57354345c5b04491645fc5269eaaaa6f8999f Mon Sep 17 00:00:00 2001 From: jackschu <31808950+jackschu@users.noreply.github.com> Date: Wed, 18 Feb 2026 08:54:19 -0500 Subject: [PATCH] fix(darwin): guard launchctl bootstrap on plist existence During home-manager activation, the bootstrap call can fail if the LaunchAgent plist hasn't been written yet. Check that the plist file exists before attempting to load it. --- modules/home-manager/sops.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/home-manager/sops.nix b/modules/home-manager/sops.nix index be11f69..b759ae0 100644 --- a/modules/home-manager/sops.nix +++ b/modules/home-manager/sops.nix @@ -411,10 +411,13 @@ in darwin = let domain-target = "gui/$(id -u ${config.home.username})"; + plist = "${config.home.homeDirectory}/Library/LaunchAgents/org.nix-community.home.sops-nix.plist"; in '' /bin/launchctl bootout ${domain-target}/org.nix-community.home.sops-nix && true - /bin/launchctl bootstrap ${domain-target} ${config.home.homeDirectory}/Library/LaunchAgents/org.nix-community.home.sops-nix.plist + if [[ -f ${plist} ]]; then + /bin/launchctl bootstrap ${domain-target} ${plist} + fi ''; linux =