From 1b39fcad8bea4beb8058fe2514a71ab9033b0558 Mon Sep 17 00:00:00 2001 From: Ryan Schanzenbacher Date: Mon, 6 Jul 2026 22:56:30 -0400 Subject: Fix gpg-agent woe --- users/ryan/home.nix | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/users/ryan/home.nix b/users/ryan/home.nix index de34c60..ffbab67 100644 --- a/users/ryan/home.nix +++ b/users/ryan/home.nix @@ -164,19 +164,28 @@ targets.darwin.linkApps.directory = "Applications/User Apps"; # Symlink System apps into the user apps "system" dir - home.activation.linkSystemApps = lib.hm.dag.entryAfter ["writeBoundary"] '' - if [[ -z "$HOME" ]]; then - echo "ERROR: HOME was not defined. This should not happen. Bailing! ">&2 - exit 1 - fi - - $DRY_RUN_CMD mkdir -p "$HOME/Applications/System Apps" - - $DRY_RUN_CMD rm -rf "$HOME/Applications/System Apps/"*.app - - $DRY_RUN_CMD find /Applications /System/Applications -maxdepth 2 -name "*.app" \ - -prune -exec ln -sf {} "$HOME/Applications/System Apps/" \; - ''; + home.activation.linkSystemApps = lib.mkIf pkgs.stdenv.isDarwin ( + lib.hm.dag.entryAfter ["writeBoundary"] '' + if [[ -z "$HOME" ]]; then + echo "ERROR: HOME was not defined. This should not happen. Bailing! ">&2 + exit 1 + fi + + $DRY_RUN_CMD mkdir -p "$HOME/Applications/System Apps" + + $DRY_RUN_CMD rm -rf "$HOME/Applications/System Apps/"*.app + + $DRY_RUN_CMD find /Applications /System/Applications -maxdepth 2 -name "*.app" \ + -prune -exec ln -sf {} "$HOME/Applications/System Apps/" \; + '' + ); + + # Restart gpg-agent + home.activation.restartGpgAgent = lib.mkIf pkgs.stdenv.isDarwin ( + lib.hm.dag.entryAfter ["writeBoundary"] '' + $DRY_RUN_CMD ${pkgs.gnupg}/bin/gpgconf --kill gpg-agent || true + '' + ); xdg.configFile."aerc" = { source = ./aerc; -- cgit v1.3