My nix-darwin and NixOS config
3
fork

Configure Feed

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

fix(darwin): restore VSCode on macOS, prevent greedy cask breakage

- home/default.nix: move vscode.nix out of the !isDarwin guard so
home-manager installs it on macOS (mac-app-util handles the app bundle)
- modules/darwin/homebrew.nix: exempt self-updating casks from greedy=true
to prevent brew upgrade removing .app bundles that fail to re-stage
(root cause of missing Element and Spotify)
- modules/darwin/common.nix: add killall Dock to postActivation so
newly-installed cask apps appear in the dock after rebuild

+35 -7
+3 -1
home/default.nix
··· 37 37 ] 38 38 ++ lib.optionals (cfg.isDesktop && !isDarwin) [ 39 39 ./programs/kde.nix # KDE Plasma settings — Linux desktop only 40 - ./programs/vscode.nix # VSCode — desktop only 40 + ] 41 + ++ lib.optionals cfg.isDesktop [ 42 + ./programs/vscode.nix # VSCode — desktop (mac-app-util handles macOS app bundle) 41 43 ] 42 44 ++ lib.optionals (cfg.isDesktop) [ 43 45 ./programs/starship.nix
+5
modules/darwin/common.nix
··· 34 34 ln -sf "$REPO/hooks/pre-commit" "$REPO/.git/hooks/pre-commit" 35 35 chmod +x "$REPO/hooks/pre-commit" 36 36 fi 37 + 38 + # Reload the Dock after activation so any Homebrew-installed apps 39 + # (e.g. Element, Spotify) that were absent when the dock plist was 40 + # written are picked up cleanly. 41 + killall Dock 2>/dev/null || true 37 42 ''; 38 43 }
+27 -6
modules/darwin/homebrew.nix
··· 5 5 let 6 6 cfg = config.myConfig; 7 7 8 - # Normalise every cask entry to an attrset and force greedy = true so 9 - # that `brew upgrade` always overwrites out-of-date casks — including 10 - # those that declare auto_updates or version :latest. 8 + # Casks that self-update their own .app bundle (auto_updates = true in the 9 + # cask definition). Forcing greedy = true on these causes brew upgrade to 10 + # remove the current .app and re-stage a fresh download, which can leave the 11 + # bundle absent if the download or staging step fails. Let the app manage 12 + # its own updates instead. 13 + selfUpdatingCasks = [ 14 + "element" 15 + "spotify" 16 + "discord" 17 + "signal" 18 + "obsidian" 19 + "claude" 20 + "firefox" 21 + "github" 22 + "steam" 23 + ]; 24 + 25 + # Normalise every cask entry to an attrset. Force greedy = true only for 26 + # casks that do NOT self-update, so `brew upgrade` keeps them current 27 + # without risking the broken-receipt problem seen with auto_updating apps. 11 28 makeGreedy = 12 29 cask: 30 + let 31 + name = if builtins.isString cask then cask else cask.name; 32 + isSelfUpdating = builtins.elem name selfUpdatingCasks; 33 + in 13 34 if builtins.isString cask then 14 35 { 15 - name = cask; 16 - greedy = true; 36 + inherit name; 37 + greedy = !isSelfUpdating; 17 38 } 18 39 else 19 - cask // { greedy = true; }; 40 + cask // { greedy = !(isSelfUpdating); }; 20 41 in 21 42 { 22 43 # Clear stale Homebrew download lock files (.incomplete) that accumulate