summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrnhmjoj <rnhmjoj@inventati.org>2020-09-01 10:38:59 +0200
committerEmilio Perez <emilio.perez-juarez@diamond.ac.uk>2020-10-04 14:56:29 +0100
commiteda7e23ea4c276e593bb399e552a5701a6e725f1 (patch)
treed4445efada247a212953c474e45428371a2e8054
parent1fdd3921a2b08a28c850e9da88f1ed67dd07b5cb (diff)
nixos/fontdir: add the directory to the xserver font paths
-rw-r--r--nixos/modules/config/fonts/fontdir.nix14
-rw-r--r--nixos/modules/services/x11/xserver.nix2
2 files changed, 10 insertions, 6 deletions
diff --git a/nixos/modules/config/fonts/fontdir.nix b/nixos/modules/config/fonts/fontdir.nix
index 098038fa6d21..52fd2677d13c 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"
+ '';
};
diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix
index c8335b697698..8223c1f1e675 100644
--- a/nixos/modules/services/x11/xserver.nix
+++ b/nixos/modules/services/x11/xserver.nix
@@ -371,7 +371,7 @@ in
type = types.lines;
default = "";
example = ''FontPath "/path/to/my/fonts"'';
- description = "Contents of the first Files section of the X server configuration file.";
+ description = "Contents of the first <literal>Files</literal> section of the X server configuration file.";
};
deviceSection = mkOption {