Skip to content

Instantly share code, notes, and snippets.

@dustinlacewell-wk
Created February 10, 2018 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dustinlacewell-wk/3493f53dec5934aacce81d750935d334 to your computer and use it in GitHub Desktop.
Save dustinlacewell-wk/3493f53dec5934aacce81d750935d334 to your computer and use it in GitHub Desktop.
config = mkIf cfg.enable {
home.packages = [ package ];
home.file = listToAttrs configFiles;
home.activation.viscosity = dagEntryAfter["installPackages"] (let
home = config.home.homeDirectory;
applications = "${home}/.nix-profile/Applications";
source = "${applications}/${appName}";
target = "${home}/Applications/";
in ''
if [ -e ${target}/${appName} ]; then
rm -r ${target}/${appName}
fi
osascript << EOF
tell application "Finder"
set mySource to POSIX file "${source}" as alias
make new alias to mySource at POSIX file "${target}"
set name of result to "${appName}"
end tell
EOF
'');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment