summary refs log tree commit diff
diff options
context:
space:
mode:
authorwucke13 <wucke13@gmail.com>2018-02-27 20:18:25 +0100
committerwucke13 <wucke13@gmail.com>2018-03-02 09:30:19 +0100
commit9580f22115dc602ad66b318755937c5444f37d3f (patch)
tree3b29e4aaa0248b0f24c18e776cf9126efe49e49c
parentdfc5d7835d6e248d3cc83430da941277ae5cabaa (diff)
downloadnixpkgs-9580f22115dc602ad66b318755937c5444f37d3f.tar
nixpkgs-9580f22115dc602ad66b318755937c5444f37d3f.tar.gz
nixpkgs-9580f22115dc602ad66b318755937c5444f37d3f.tar.bz2
nixpkgs-9580f22115dc602ad66b318755937c5444f37d3f.tar.lz
nixpkgs-9580f22115dc602ad66b318755937c5444f37d3f.tar.xz
nixpkgs-9580f22115dc602ad66b318755937c5444f37d3f.tar.zst
nixpkgs-9580f22115dc602ad66b318755937c5444f37d3f.zip
Solving #30396
-rw-r--r--nixos/modules/services/editors/emacs.nix21
1 files changed, 20 insertions, 1 deletions
diff --git a/nixos/modules/services/editors/emacs.nix b/nixos/modules/services/editors/emacs.nix
index 2c5a0c4849e..d61e7e7233e 100644
--- a/nixos/modules/services/editors/emacs.nix
+++ b/nixos/modules/services/editors/emacs.nix
@@ -15,6 +15,25 @@ let
     fi
   '';
 
+desktopApplicationFile = pkgs.writeTextFile {
+  name = "emacsclient.desktop";
+  destination = "/share/applications/emacsclient.desktop";
+  text = ''
+[Desktop Entry]
+Name=Emacsclient
+GenericName=Text Editor
+Comment=Edit text
+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++;
+Exec=emacseditor %F
+Icon=emacs
+Type=Application
+Terminal=false
+Categories=Development;TextEditor;
+StartupWMClass=Emacs
+Keywords=Text;Editor;
+'';
+};
+
 in {
 
   options.services.emacs = {
@@ -74,7 +93,7 @@ in {
       };
     } // optionalAttrs cfg.enable { wantedBy = [ "default.target" ]; };
 
-    environment.systemPackages = [ cfg.package editorScript ];
+    environment.systemPackages = [ cfg.package editorScript desktopApplicationFile ];
 
     environment.variables = {
       # This is required so that GTK applications launched from Emacs