about summary refs log tree commit diff
diff options
context:
space:
mode:
authordevhell <devhell@mailfresser.de>2023-01-26 13:43:53 +0000
committerdevhell <devhell@mailfresser.de>2023-01-26 13:43:53 +0000
commit6c47038248e424f512465f8997184c6424134997 (patch)
tree6aa70235d90fbcef940ce2a6bca68024fd0051e5
parent42433e738bb3c317f6ade16299c14ea7a0dcfbef (diff)
profiles/base: nerdfonts selection, but elegant
Thanks again, @aszlig!
-rw-r--r--modules/user/devhell/profiles/base.nix21
1 files changed, 18 insertions, 3 deletions
diff --git a/modules/user/devhell/profiles/base.nix b/modules/user/devhell/profiles/base.nix
index 25a7f7af..d69c8314 100644
--- a/modules/user/devhell/profiles/base.nix
+++ b/modules/user/devhell/profiles/base.nix
@@ -152,7 +152,22 @@ in {
         useEmbeddedBitmaps = true;
       };
       enableGhostscriptFonts = true;
-      fonts = with pkgs; [
+      fonts = let
+        mkNerdFont = src: pkgs.stdenv.mkDerivation {
+          name = lib.removeSuffix ".zip" src.name;
+          inherit src;
+          sourceRoot = ".";
+          nativeBuildInputs = [ pkgs.unzip ];
+          dontBuild = true;
+          patchPhase = "find -iname '*Windows Compatible*' -delete";
+          installPhase = ''
+            find -iname '*.otf' -exec install -vD -m0644 {} \
+              "$out/share/fonts/opentype/NerdFonts/{}" \;
+            find -iname '*.ttf' -exec install -vD -m0644 {} \
+              "$out/share/fonts/truetype/NerdFonts/{}" \;
+          '';
+        };
+      in with pkgs; [
         clearlyU
         fixedsys-excelsior
         cm_unicode
@@ -162,7 +177,6 @@ in {
         freefont_ttf
         google-fonts
         junicode
-        (nerdfonts.override { fonts = [ "DejaVuSansMono" "CascadiaCode" "FiraMono" "Inconsolata" "NerdFontsSymbolsOnly" "Noto" ]; })
         siji
         tewi-font
         tt2020
@@ -170,7 +184,8 @@ in {
         unifont
         vistafonts
         wqy_microhei
-      ] ++ lib.filter lib.isDerivation (lib.attrValues lohit-fonts);
+      ] ++ lib.filter lib.isDerivation (lib.attrValues lohit-fonts)
+        ++ map mkNerdFont pkgs.nerdfonts.srcs;
     };
   };
 }