1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-22 13:41:26 +00:00

neovim: Do $PATH lookup in neovim.desktop instead of hardcoding derivation

See db236e588d "steam: Do $PATH lookup in steam.desktop [...]".
tl;dr: Otherwise widget/panel/desktop icons in DEs like KDE break.

Simply stop adding the full derivation path for neovim and stick with
how upstream uses no path at all.

While here, take care of gnvim.desktop as well by adjusting the sed(1)
expression (and simplifying it in one go);  I do not use gnvim.desktop
but built it and confirmed the resulting files to contain no full paths
any longer.
This commit is contained in:
Klemens Nanni 2020-11-05 02:12:50 +01:00 committed by Andreas Rammhold
parent ce08cf0a29
commit e0f258f596
No known key found for this signature in database
GPG key ID: E432E410B5E48C86
2 changed files with 1 additions and 4 deletions

View file

@ -23,9 +23,7 @@ stdenv.mkDerivation {
cp -r '${gnvim-unwrapped}/share/applications' "$out/share/applications"
# Sed needs a writable directory to do inplace modifications
chmod u+rw "$out/share/applications"
for file in $out/share/applications/*.desktop; do
sed -e "s|Exec=.\\+gnvim\\>|Exec=$out/bin/gnvim|" -i "$file"
done
sed -e "s|Exec=.\\+gnvim\\>|Exec=gnvim|" -i $out/share/applications/*.desktop
'';
preferLocalBuild = true;

View file

@ -43,7 +43,6 @@ let
postBuild = lib.optionalString stdenv.isLinux ''
rm $out/share/applications/nvim.desktop
substitute ${neovim}/share/applications/nvim.desktop $out/share/applications/nvim.desktop \
--replace 'TryExec=nvim' "TryExec=$out/bin/nvim" \
--replace 'Name=Neovim' 'Name=WrappedNeovim'
''
+ optionalString withPython2 ''