emacs: remove use of makeDesktopItem

Can generate the file directly to avoid the dependency on the
`makeDesktopItem` API.
This commit is contained in:
Robert Helgesson 2020-10-22 21:52:22 +02:00
parent 77913ff17e
commit 18429f1d1d
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
2 changed files with 26 additions and 27 deletions

View file

@ -10,24 +10,24 @@ let
emacsVersion = getVersion emacsCfg.finalPackage; emacsVersion = getVersion emacsCfg.finalPackage;
# Adapted from upstream emacs.desktop # Adapted from upstream emacs.desktop
clientDesktopItem = pkgs.makeDesktopItem rec { clientDesktopItem = pkgs.writeTextDir "share/applications/emacsclient.desktop"
name = "emacsclient"; (generators.toINI { } {
desktopName = "Emacs Client"; "Desktop Entry" = {
genericName = "Text Editor"; Type = "Application";
comment = "Edit text"; Exec = "${emacsBinPath}/emacsclient ${
mimeType = concatStringsSep " " cfg.client.arguments
"text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;"; } %F";
exec = "${emacsBinPath}/emacsclient ${ Terminal = false;
concatStringsSep " " cfg.client.arguments Name = "Emacs Client";
} %F"; Icon = "emacs";
icon = "emacs"; Comment = "Edit text";
type = "Application"; GenericName = "Text Editor";
terminal = "false"; MimeType =
categories = "Utility;TextEditor;"; "text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;";
extraEntries = '' Categories = "Utility;TextEditor;";
StartupWMClass=Emacs StartupWMClass = "Emacs";
''; };
}; });
# Match the default socket path for the Emacs version so emacsclient continues # Match the default socket path for the Emacs version so emacsclient continues
# to work without wrapping it. It might be worthwhile to allow customizing the # to work without wrapping it. It might be worthwhile to allow customizing the

View file

@ -1,12 +1,11 @@
[Desktop Entry] [Desktop Entry]
Type=Application
Exec=@emacs@/bin/emacsclient -c %F
Terminal=false
Name=Emacs Client
Icon=emacs
Comment=Edit text
GenericName=Text Editor
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
Categories=Utility;TextEditor; Categories=Utility;TextEditor;
Comment=Edit text
Exec=@emacs@/bin/emacsclient -c %F
GenericName=Text Editor
Icon=emacs
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
Name=Emacs Client
StartupWMClass=Emacs StartupWMClass=Emacs
Terminal=false
Type=Application