From 0c4f3acb281be6290c55a6e96bc29fab5b5c7a11 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 11 Sep 2023 18:24:28 +0200 Subject: stockholm -> hrm --- configs/xserver/xserver.conf.nix | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 configs/xserver/xserver.conf.nix (limited to 'configs/xserver/xserver.conf.nix') diff --git a/configs/xserver/xserver.conf.nix b/configs/xserver/xserver.conf.nix new file mode 100644 index 0000000..3a80567 --- /dev/null +++ b/configs/xserver/xserver.conf.nix @@ -0,0 +1,38 @@ +{ config, pkgs, ... }: + +let + cfg = config.services.xserver; +in + +pkgs.stdenv.mkDerivation { + name = "xserver.conf"; + + fontPath = optionalString (cfg.fontPath != null) + ''FontPath "${toString cfg.fontPath}"''; + + inherit (cfg) config; + + buildCommand = + '' + echo 'Section "Files"' >> $out + echo $fontPath >> $out + + for i in ${toString config.fonts.fonts}; do + if test "''${i:0:''${#NIX_STORE}}" == "$NIX_STORE"; then + for j in $(find $i -name fonts.dir); do + echo " FontPath \"$(dirname $j)\"" >> $out + done + fi + done + + for i in $(find ${toString cfg.modules} -type d); do + if test $(echo $i/*.so* | wc -w) -ne 0; then + echo " ModulePath \"$i\"" >> $out + fi + done + + echo 'EndSection' >> $out + + echo "$config" >> $out + ''; +} -- cgit v1.2.3