diff options
author | rnhmjoj <rnhmjoj@inventati.org> | 2020-09-01 10:38:59 +0200 |
---|---|---|
committer | Emilio Perez <emilio.perez-juarez@diamond.ac.uk> | 2020-10-04 14:56:29 +0100 |
commit | eda7e23ea4c276e593bb399e552a5701a6e725f1 (patch) | |
tree | d4445efada247a212953c474e45428371a2e8054 /nixos/modules/config | |
parent | 1fdd3921a2b08a28c850e9da88f1ed67dd07b5cb (diff) |
nixos/fontdir: add the directory to the xserver font paths
Diffstat (limited to 'nixos/modules/config')
-rw-r--r-- | nixos/modules/config/fonts/fontdir.nix | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/nixos/modules/config/fonts/fontdir.nix b/nixos/modules/config/fonts/fontdir.nix index 098038fa6d21e..52fd2677d13c0 100644 --- a/nixos/modules/config/fonts/fontdir.nix +++ b/nixos/modules/config/fonts/fontdir.nix @@ -5,11 +5,11 @@ with lib; let x11Fonts = pkgs.runCommand "X11-fonts" { preferLocalBuild = true; } '' - mkdir -p "$out/share/X11-fonts" + mkdir -p "$out/share/X11/fonts" font_regexp='.*\.\(ttf\|otf\|pcf\|pfa\|pfb\|bdf\)\(\.gz\)?' find ${toString config.fonts.fonts} -regex "$font_regexp" \ - -exec ln -sf -t "$out/share/X11-fonts" '{}' \; - cd "$out/share/X11-fonts" + -exec ln -sf -t "$out/share/X11/fonts" '{}' \; + cd "$out/share/X11/fonts" ${pkgs.xorg.mkfontscale}/bin/mkfontscale ${pkgs.xorg.mkfontdir}/bin/mkfontdir cat $(find ${pkgs.xorg.fontalias}/ -name fonts.alias) >fonts.alias @@ -28,7 +28,7 @@ in default = false; description = '' Whether to create a directory with links to all fonts in - <filename>/run/current-system/sw/share/X11-fonts</filename>. + <filename>/run/current-system/sw/share/X11/fonts</filename>. ''; }; @@ -38,9 +38,13 @@ in config = mkIf config.fonts.enableFontDir { + # This is enough to make a symlink because the xserver + # module already links all /share/X11 paths. environment.systemPackages = [ x11Fonts ]; - environment.pathsToLink = [ "/share/X11-fonts" ]; + services.xserver.filesSection = '' + FontPath "${x11Fonts}/share/X11/fonts" + ''; }; |