diff options
author | Joachim Fasting <joachifm@users.noreply.github.com> | 2016-05-27 16:17:58 +0200 |
---|---|---|
committer | Joachim Fasting <joachifm@users.noreply.github.com> | 2016-05-27 16:17:58 +0200 |
commit | f7e7b814a95641e93543647c8777edaf16b17541 (patch) | |
tree | 3d4587ab7dc3e6a1a48cad0f65a320aa8be7199d /nixos/modules | |
parent | 5f6542de2a038b891afe0bcbd50fdd3f7536e1a3 (diff) | |
parent | b24e58a82ba3323ca0aa4db80a80e7725c7ff21d (diff) |
Merge pull request #15668 from joachifm/fontDir-builderDefs
config.fonts.fontdir: use runCommand instead of builderDefs
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/config/fonts/fontdir.nix | 54 |
1 files changed, 13 insertions, 41 deletions
diff --git a/nixos/modules/config/fonts/fontdir.nix b/nixos/modules/config/fonts/fontdir.nix index c78b52fe29e1..180e38f81f4f 100644 --- a/nixos/modules/config/fonts/fontdir.nix +++ b/nixos/modules/config/fonts/fontdir.nix @@ -4,47 +4,17 @@ with lib; let - fontDirs = config.fonts.fonts; - - localDefs = with pkgs.builderDefs; pkgs.builderDefs.passthru.function rec { - src = "";/* put a fetchurl here */ - buildInputs = [pkgs.xorg.mkfontdir pkgs.xorg.mkfontscale]; - inherit fontDirs; - installPhase = fullDepEntry (" - list=''; - for i in ${toString fontDirs} ; do - if [ -d \$i/ ]; then - list=\"\$list \$i\"; - fi; - done - list=\$(find \$list -name fonts.dir -o -name '*.ttf' -o -name '*.otf'); - fontDirs=''; - for i in \$list ; do - fontDirs=\"\$fontDirs \$(dirname \$i)\"; - done; - mkdir -p \$out/share/X11-fonts/; - find \$fontDirs -type f -o -type l | while read i; do - j=\"\${i##*/}\" - if ! test -e \"\$out/share/X11-fonts/\${j}\"; then - ln -s \"\$i\" \"\$out/share/X11-fonts/\${j}\"; - fi; - done; - cd \$out/share/X11-fonts/ - rm fonts.dir - rm fonts.scale - rm fonts.alias - mkfontdir - mkfontscale - cat \$( find ${pkgs.xorg.fontalias}/ -name fonts.alias) >fonts.alias - ") ["minInit" "addInputs"]; - }; - - x11Fonts = with localDefs; stdenv.mkDerivation rec { - name = "X11-fonts"; - builder = writeScript (name + "-builder") - (textClosure localDefs - [installPhase doForceShare doPropagate]); - }; + x11Fonts = pkgs.runCommand "X11-fonts" { } '' + mkdir -p "$out/share/X11-fonts" + find ${toString config.fonts.fonts} \ + \( -name fonts.dir -o -name '*.ttf' -o -name '*.otf' \) \ + -exec ln -sf -t "$out/share/X11-fonts" '{}' \; + cd "$out/share/X11-fonts" + rm -f fonts.dir fonts.scale fonts.alias + ${pkgs.xorg.mkfontdir}/bin/mkfontdir + ${pkgs.xorg.mkfontscale}/bin/mkfontscale + cat $(find ${pkgs.xorg.fontalias}/ -name fonts.alias) >fonts.alias + ''; in @@ -70,6 +40,8 @@ in environment.systemPackages = [ x11Fonts ]; + environment.pathsToLink = [ "/share/X11-fonts" ]; + }; } |