summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2019-06-27 16:40:07 +0200
committerAlan Pearce2019-06-27 16:40:07 +0200
commit473a10c40202f3934c355624d67c82e30b120f13 (patch)
treede547f5516abce811c0cff314be6025da8084054
parent54bc9ec3052b951e09fa3e1934d0cb0dfb300bf3 (diff)
downloadnixos-configuration-473a10c40202f3934c355624d67c82e30b120f13.tar.lz
nixos-configuration-473a10c40202f3934c355624d67c82e30b120f13.tar.zst
nixos-configuration-473a10c40202f3934c355624d67c82e30b120f13.zip
Tweak fonts
-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 041d10f..34efd50 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 3996497..b0d6651 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 = {