From c0fa7092a636c153e24af527bb06eeca02f96edc Mon Sep 17 00:00:00 2001 From: utopiaeh Date: Wed, 14 Oct 2026 23:10:10 +0300 Subject: [PATCH 1/2] feat(homebrew): skip Gatekeeper prompt for declared casks only --- hosts/common/darwin/homebrew.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hosts/common/darwin/homebrew.nix b/hosts/common/darwin/homebrew.nix index 92e82f8c..ac2b02ad 100644 --- a/hosts/common/darwin/homebrew.nix +++ b/hosts/common/darwin/homebrew.nix @@ -16,7 +16,6 @@ casks = [ - "claude" "telegram" "iterm2" @@ -28,6 +27,7 @@ # Utils "openlogi" + "artginzburg/tap/wheelclick" "transmission" "pearcleaner" @@ -44,9 +44,9 @@ "docker-desktop" - "macshot" + "sw33tlie/homebrew-macshot/macshot" - "sanyam-g/switch/switch" + "sanyam-g/homebrew-switch/switch" "abue-ammar/homebrew-tinycast/tinycast@beta" "hamed-elfayome/claude-usage/claude-usage-tracker" ]; From 2945fdceb11c5ae4e5f0b2bf47c5cc605b338dee Mon Sep 17 00:00:00 2001 From: utopiaeh Date: Thu, 15 Oct 2026 16:10:48 +0300 Subject: [PATCH 2/2] fix(homebrew): restore claude/macshot/switch casks and Gatekeeper step --- home-manager/profiles/base.nix | 4 ++++ hosts/common/darwin/homebrew.nix | 31 +++++++++++++++++++++++++--- hosts/darwin/flow48/custom-dock.nix | 2 ++ hosts/darwin/mac-pro/custom-dock.nix | 3 +++ 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/home-manager/profiles/base.nix b/home-manager/profiles/base.nix index a730adf3..7832a5b4 100644 --- a/home-manager/profiles/base.nix +++ b/home-manager/profiles/base.nix @@ -33,6 +33,10 @@ in neovim ]; + # Stable path for macOS java_home and IDEA's JDK detection; JAVA_HOME's store path changes on every update + home.file."Library/Java/JavaVirtualMachines/zulu-25.jdk".source = + "${config.programs.java.package}/Library/Java/JavaVirtualMachines/zulu-25.jdk"; + home.sessionVariables = { EDITOR = "nvim"; VISUAL = "nvim"; diff --git a/hosts/common/darwin/homebrew.nix b/hosts/common/darwin/homebrew.nix index ac2b02ad..224334e7 100644 --- a/hosts/common/darwin/homebrew.nix +++ b/hosts/common/darwin/homebrew.nix @@ -1,3 +1,14 @@ +{ + config, + lib, + pkgs, + username, + ... +}: + +let + caskNames = lib.concatMapStringsSep " " (c: lib.escapeShellArg c.name) config.homebrew.casks; +in { homebrew = { enable = true; @@ -16,6 +27,7 @@ casks = [ + "claude" "telegram" "iterm2" @@ -27,7 +39,6 @@ # Utils "openlogi" - "artginzburg/tap/wheelclick" "transmission" "pearcleaner" @@ -44,9 +55,9 @@ "docker-desktop" - "sw33tlie/homebrew-macshot/macshot" + "macshot" - "sanyam-g/homebrew-switch/switch" + "sanyam-g/switch/switch" "abue-ammar/homebrew-tinycast/tinycast@beta" "hamed-elfayome/claude-usage/claude-usage-tracker" ]; @@ -56,4 +67,18 @@ "Xcode" = 497799835; }; }; + + # Gatekeeper stays on (LSQuarantine default) for everything else; only apps from the casks + # declared above skip the "downloaded from the Internet" prompt. Homebrew removed --no-quarantine. + system.activationScripts.postActivation.text = lib.mkAfter '' + echo "❯❯❯❯ · Removing quarantine from declared Homebrew casks..." + apps=$(sudo --user=${username} --set-home env HOMEBREW_NO_AUTO_UPDATE=1 \ + /opt/homebrew/bin/brew info --json=v2 --cask ${caskNames} 2>/dev/null \ + | ${pkgs.jq}/bin/jq -r '.casks[].artifacts[] | select(has("app")) | .target // empty' || true) + while IFS= read -r app; do + if [ -d "$app" ] && xattr -p com.apple.quarantine "$app" >/dev/null 2>&1; then + xattr -dr com.apple.quarantine "$app" || true + fi + done <<< "$apps" + ''; } diff --git a/hosts/darwin/flow48/custom-dock.nix b/hosts/darwin/flow48/custom-dock.nix index 162c16fa..68990ece 100644 --- a/hosts/darwin/flow48/custom-dock.nix +++ b/hosts/darwin/flow48/custom-dock.nix @@ -4,6 +4,7 @@ "/Applications/Zen.app" "/Applications/Zed.app" + "/Applications/IntelliJ IDEA.app" "/Applications/iTerm.app" "/Applications/Telegram.app" @@ -12,6 +13,7 @@ "/Applications/Claude.app" "/Applications/Spotify.app" + "/Applications/Notion.app" ]; }; } diff --git a/hosts/darwin/mac-pro/custom-dock.nix b/hosts/darwin/mac-pro/custom-dock.nix index 796dfb6e..dff184ca 100644 --- a/hosts/darwin/mac-pro/custom-dock.nix +++ b/hosts/darwin/mac-pro/custom-dock.nix @@ -4,6 +4,7 @@ "/Applications/Zen.app" "/Applications/Zed.app" + "/Applications/IntelliJ IDEA.app" "/Applications/iTerm.app" "/Applications/Telegram.app" @@ -11,6 +12,8 @@ "/Applications/Claude.app" "/Applications/Spotify.app" + + "/Applications/Notion.app" ]; }; }