diff options
author | lassulus <lassulus@lassul.us> | 2017-12-03 23:00:24 +0100 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2017-12-03 23:00:24 +0100 |
commit | 1d687bb2a8e3ee0d129b01a645f998b3cdafd82d (patch) | |
tree | 4467f50f59bdd0d2824c3d474a18051781105559 /lass/3modules/xserver/xserver.conf.nix | |
parent | 3cd8dee321daa694ef6d9ae2f7731daccd0a6062 (diff) |
l: add xserver module
Diffstat (limited to 'lass/3modules/xserver/xserver.conf.nix')
-rw-r--r-- | lass/3modules/xserver/xserver.conf.nix | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/lass/3modules/xserver/xserver.conf.nix b/lass/3modules/xserver/xserver.conf.nix new file mode 100644 index 000000000..6f34e0150 --- /dev/null +++ b/lass/3modules/xserver/xserver.conf.nix @@ -0,0 +1,40 @@ +{ config, lib, pkgs, ... }: + +with import <stockholm/lib>; + +let + cfg = config.services.xserver; +in + +pkgs.stdenv.mkDerivation { + name = "xserver.conf"; + + xfs = optionalString (cfg.useXFS != false) + ''FontPath "${toString cfg.useXFS}"''; + + inherit (cfg) config; + + buildCommand = + '' + echo 'Section "Files"' >> $out + echo $xfs >> $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 + ''; +} |