Forked from elliottminns/nix-darwin-activation.nix
Last active
December 10, 2025 19:19
-
-
Save seriouspoop/275152ccc988f50379c6906805ff9e15 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| system.activationScripts.applications.text = let | |
| env = pkgs.buildEnv { | |
| name = "system-applications"; | |
| paths = config.environment.systemPackages; | |
| pathsToLink = ["/Applications"]; | |
| }; | |
| in | |
| pkgs.lib.mkForce '' | |
| # Set up applications. | |
| echo "setting up /Applications..." >&2 | |
| rm -rf /Applications/Nix\ Apps | |
| mkdir -p /Applications/Nix\ Apps | |
| find ${env}/Applications -maxdepth 1 -type l -exec readlink '{}' + | | |
| while read -r src; do | |
| app_name=$(basename "$src") | |
| echo "copying $src" >&2 | |
| ${pkgs.mkalias}/bin/mkalias "$src" "/Applications/Nix Apps/$app_name" | |
| done | |
| ''; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment