My nix-darwin and NixOS config
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

darwin: auto-clean stale brew download locks on activation

Add a preActivation script to remove .incomplete lock files from the
Homebrew downloads cache before brew bundle runs. Prevents subsequent
activations from failing when a previous nrs was interrupted mid-fetch.

+10
+10
modules/darwin/homebrew.nix
··· 13 13 if builtins.isString cask then { name = cask; greedy = true; } else cask // { greedy = true; }; 14 14 in 15 15 { 16 + # Clear stale Homebrew download lock files (.incomplete) that accumulate 17 + # when a previous activation is interrupted mid-fetch. These cause the 18 + # next `brew bundle` to refuse to re-download the same file. 19 + system.activationScripts.preActivation.text = '' 20 + stale_dir="/Users/${cfg.user.username}/Library/Caches/Homebrew/downloads" 21 + if [ -d "$stale_dir" ]; then 22 + find "$stale_dir" -maxdepth 1 -name '*.incomplete' -delete 23 + fi 24 + ''; 25 + 16 26 # Homebrew configuration — all values driven from myConfig.darwin.homebrew 17 27 homebrew = { 18 28 inherit (cfg.darwin.homebrew) enable taps brews masApps;