Created
March 12, 2025 06:15
-
-
Save fiddlerwoaroof/c0f48a215e76e297d012ea348bc2fdf2 to your computer and use it in GitHub Desktop.
Home-manager module for Mac apps
This file contains 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
{ | |
lib, | |
config, | |
pkgs, | |
emacs-pkgs, | |
fwoar-pkgs, | |
... | |
}: { | |
home.packages = [ | |
pkgs.crawlTiles | |
fwoar-pkgs.iterm2 | |
emacs-pkgs.emacs-git | |
]; | |
home.activation.install-apps = lib.hm.dag.entryAfter ["linkGeneration"] '' | |
new_nix_apps="${config.home.homeDirectory}/Applications/Nix" | |
rm -rf "$new_nix_apps" | |
mkdir -p "$new_nix_apps" | |
find -H -L "$genProfilePath/home-files/Applications" -maxdepth 2 -name "*.app" -type d -print | while read -r app; do | |
real_app=$(readlink -f "$app") | |
app_name=$(basename "$app") | |
target_app="$new_nix_apps/$app_name" | |
echo "Link '$real_app' to '$target_app'" | |
mkdir -p $target_app | |
"${pkgs.xorg.lndir}"/bin/lndir "$real_app" "$target_app" 2>&1>/dev/null | |
rm "$target_app/Contents/Info.plist" | |
cp "$real_app/Contents/Info.plist" "$target_app/Contents/Info.plist" | |
done | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment