From 86d2e3b00561a166f8c31ff9ec6a947ca0992ec5 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Tue, 18 Mar 2025 09:17:08 -0500 Subject: [PATCH] launchd: remove checkLaunchAgents We don't care about conflicts, they are launch agents and need to represent the latest changes. This check had more negatives than benefits. --- modules/launchd/default.nix | 38 ------------------------------------- 1 file changed, 38 deletions(-) diff --git a/modules/launchd/default.nix b/modules/launchd/default.nix index 9e5e2a516..2361280a0 100644 --- a/modules/launchd/default.nix +++ b/modules/launchd/default.nix @@ -90,44 +90,6 @@ in { ln -s "${agentsDrv}" $out/LaunchAgents ''; - home.activation.checkLaunchAgents = - hm.dag.entryBefore [ "writeBoundary" ] '' - checkLaunchAgents() { - local oldDir newDir dstDir err - oldDir="" - err=0 - if [[ -n "''${oldGenPath:-}" ]]; then - oldDir="$(readlink -m "$oldGenPath/LaunchAgents")" || err=$? - if (( err )); then - oldDir="" - fi - fi - newDir=${escapeShellArg agentsDrv} - dstDir=${escapeShellArg dstDir} - - local oldSrcPath newSrcPath dstPath agentFile agentName - - find -L "$newDir" -maxdepth 1 -name '*.plist' -type f -print0 \ - | while IFS= read -rd "" newSrcPath; do - agentFile="''${newSrcPath##*/}" - agentName="''${agentFile%.plist}" - dstPath="$dstDir/$agentFile" - oldSrcPath="$oldDir/$agentFile" - - if [[ ! -e "$dstPath" ]]; then - continue - fi - - if ! cmp --quiet "$oldSrcPath" "$dstPath"; then - errorEcho "Existing file '$dstPath' is in the way of '$newSrcPath'" - exit 1 - fi - done - } - - checkLaunchAgents - ''; - # NOTE: Launch Agent configurations can't be symlinked from the Nix store # because it needs to be owned by the user running it. home.activation.setupLaunchAgents =