nixos/emacs: formatted with nixpkgs-fmt

This commit is contained in:
paumr 2020-05-09 11:36:06 +02:00 committed by Alyssa Ross
parent f299f5d6a4
commit d420369354
1 changed files with 23 additions and 22 deletions

View File

@ -15,26 +15,27 @@ let
fi fi
''; '';
desktopApplicationFile = pkgs.writeTextFile { desktopApplicationFile = pkgs.writeTextFile {
name = "emacsclient.desktop"; name = "emacsclient.desktop";
destination = "/share/applications/emacsclient.desktop"; destination = "/share/applications/emacsclient.desktop";
text = '' text = ''
[Desktop Entry] [Desktop Entry]
Name=Emacsclient Name=Emacsclient
GenericName=Text Editor GenericName=Text Editor
Comment=Edit text 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++; 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 Exec=emacseditor %F
Icon=emacs Icon=emacs
Type=Application Type=Application
Terminal=false Terminal=false
Categories=Development;TextEditor; Categories=Development;TextEditor;
StartupWMClass=Emacs StartupWMClass=Emacs
Keywords=Text;Editor; Keywords=Text;Editor;
''; '';
}; };
in { in
{
options.services.emacs = { options.services.emacs = {
enable = mkOption { enable = mkOption {
@ -86,10 +87,10 @@ in {
description = "Emacs: the extensible, self-documenting text editor"; description = "Emacs: the extensible, self-documenting text editor";
serviceConfig = { serviceConfig = {
Type = "forking"; Type = "forking";
ExecStart = "${pkgs.bash}/bin/bash -c 'source ${config.system.build.setEnvironment}; exec ${cfg.package}/bin/emacs --daemon'"; ExecStart = "${pkgs.bash}/bin/bash -c 'source ${config.system.build.setEnvironment}; exec ${cfg.package}/bin/emacs --daemon'";
ExecStop = "${cfg.package}/bin/emacsclient --eval (kill-emacs)"; ExecStop = "${cfg.package}/bin/emacsclient --eval (kill-emacs)";
Restart = "always"; Restart = "always";
}; };
} // optionalAttrs cfg.enable { wantedBy = [ "default.target" ]; }; } // optionalAttrs cfg.enable { wantedBy = [ "default.target" ]; };