diff --git a/modules/darwin/system/interface/default.nix b/modules/darwin/system/interface/default.nix index 2f14504..8bad001 100644 --- a/modules/darwin/system/interface/default.nix +++ b/modules/darwin/system/interface/default.nix @@ -13,6 +13,26 @@ in system.defaults = { dock.autohide = true; + 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 src; do + app_name=$(basename "$src") + echo "copying $src" >&2 + ${pkgs.mkalias}/bin/mkalias "$src" "/Applications/Nix Apps/$app_name" + done + ''; + finder = { AppleShowAllExtensions = true; FXEnableExtensionChangeWarning = false;