From 6c47038248e424f512465f8997184c6424134997 Mon Sep 17 00:00:00 2001 From: devhell Date: Thu, 26 Jan 2023 13:43:53 +0000 Subject: profiles/base: nerdfonts selection, but elegant Thanks again, @aszlig! --- modules/user/devhell/profiles/base.nix | 21 ++++++++++++++++++--- 1 file 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; }; }; } -- cgit 1.4.1