summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--modules/services/xserver.nix17
-rw-r--r--modules/user-interface.nix35
2 files changed, 39 insertions, 13 deletions
diff --git a/modules/services/xserver.nix b/modules/services/xserver.nix
index 041d10fa..34efd50a 100644
--- a/modules/services/xserver.nix
+++ b/modules/services/xserver.nix
@@ -35,15 +35,15 @@
     enableDefaultFonts = true;
     fontconfig = {
       defaultFonts = {
-        monospace = [ "Liberation Mono" ];
-        sansSerif = [ "Liberation Sans" ];
-        serif = [ "Liberation Serif" ];
+        monospace = [ "IBM Plex Mono" ];
+        sansSerif = [ "Roboto" ];
+        serif = [ "Roboto Slab" ];
       };
       penultimate = {
-        enable = false;
+        enable = true;
       };
       ultimate = {
-        enable = true;
+        enable = false;
         preset = "osx";
       };
     };
@@ -60,15 +60,14 @@
       fira-code
       fira-mono
       go-font
-      font-awesome-ttf
+      font-awesome_5
+      ibm-plex
       liberation_ttf
       mononoki
       opensans-ttf
       roboto
       roboto-mono
-      paratype-pt-mono
-      paratype-pt-sans
-      paratype-pt-serif
+      roboto-slab
       source-code-pro
       source-sans-pro
       source-serif-pro
diff --git a/modules/user-interface.nix b/modules/user-interface.nix
index 39964971..b0d66516 100644
--- a/modules/user-interface.nix
+++ b/modules/user-interface.nix
@@ -4,6 +4,32 @@ let
   emacsPackage = import ../packages/emacs.nix {
     pkgs = pkgs.unstable;
   };
+  editorScript = pkgs.writeScriptBin "edit" ''
+    #!${pkgs.runtimeShell}
+    if [ -z "$1" ]; then
+      exec ${emacsPackage}/bin/emacsclient --create-frame --alternate-editor ${emacsPackage}/bin/emacs
+    else
+      exec ${emacsPackage}/bin/emacsclient --alternate-editor ${emacsPackage}/bin/emacs "$@"
+    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
 { programs.browserpass.enable = true;
   documentation.info.enable = true;
@@ -58,10 +84,11 @@ in
     };
   };
 
-  services.emacs = {
-    enable = true;
-    defaultEditor = true;
-    package = emacsPackage;
+  environment.variables = {
+    # This is required so that GTK applications launched from Emacs
+    # get properly themed:
+    GTK_DATA_PREFIX = "${config.system.path}";
+    EDITOR = lib.mkOverride 900 "${editorScript}/bin/edit";
   };
 
   services.redshift = {