Skip to content

Instantly share code, notes, and snippets.

@berryp
Created December 3, 2022 09:07
Show Gist options
  • Save berryp/7af4a1f534027807b26fff706a61b1ce to your computer and use it in GitHub Desktop.
Save berryp/7af4a1f534027807b26fff706a61b1ce to your computer and use it in GitHub Desktop.
Have nix-darwin installed GUI show up in Spotlight
{ config, lib, pkgs, ... }:
{
# Import this module in your nix-darin config to have applications copied
# to /Applications/Nix Apps instead of being symlinked. GUI apps must be
# added to environment packages, not home-manager for this to work.
system.activationScripts.applications.text = lib.mkForce ''
echo "Setting up /Applications/Nix Apps" >&2
appsSrc="${config.system.build.applications}/Applications/"
baseDir="/Applications/Nix Apps"
rsyncArgs="--archive --checksum --chmod=-w --copy-unsafe-links --delete"
mkdir -p "$baseDir"
${pkgs.rsync}/bin/rsync $rsyncArgs "$appsSrc" "$baseDir"
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment