diff --git a/modules/misc/nixgl.nix b/modules/misc/nixgl.nix index b6cff7cc0..16a00a755 100644 --- a/modules/misc/nixgl.nix +++ b/modules/misc/nixgl.nix @@ -57,6 +57,17 @@ in { echo "exec -a \"\$0\" ${cfg.prefix} $file \"\$@\"" >> "$out/bin/$(basename $file)" chmod +x "$out/bin/$(basename $file)" done + + # If .desktop files refer to the old package, replace the references + for dsk in "$out/share/applications"/*.desktop ; do + if ! grep "${pkg.out}" "$dsk" > /dev/null; then + continue + fi + src="$(readlink "$dsk")" + rm "$dsk" + sed "s|${pkg.out}|$out|g" "$src" > "$dsk" + done + shopt -u nullglob # Revert nullglob back to its normal default state ''; }));