l xserver: add dpi support

This commit is contained in:
lassulus 2017-12-04 11:52:00 +01:00
parent 99468fec8f
commit 3a38f5b6ea

View File

@ -10,6 +10,7 @@ let
user = config.krebs.build.user; user = config.krebs.build.user;
cfg = config.lass.xserver; cfg = config.lass.xserver;
xcfg = config.services.xserver;
api = { api = {
enable = mkEnableOption "lass xserver"; enable = mkEnableOption "lass xserver";
}; };
@ -31,11 +32,11 @@ let
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
requires = [ "xserver.service" ]; requires = [ "xserver.service" ];
environment = { environment = {
DISPLAY = ":${toString config.services.xserver.display}"; DISPLAY = ":${toString xcfg.display}";
XMONAD_STARTUP_HOOK = pkgs.writeDash "xmonad-startup-hook" '' XMONAD_STARTUP_HOOK = pkgs.writeDash "xmonad-startup-hook" ''
${pkgs.xorg.xhost}/bin/xhost +LOCAL: & ${pkgs.xorg.xhost}/bin/xhost +LOCAL: &
${config.services.xserver.displayManager.sessionCommands} ${xcfg.displayManager.sessionCommands}
wait wait
''; '';
@ -62,22 +63,26 @@ let
XORG_DRI_DRIVER_PATH = "/run/opengl-driver/lib/dri"; # !!! Depends on the driver selected at runtime. XORG_DRI_DRIVER_PATH = "/run/opengl-driver/lib/dri"; # !!! Depends on the driver selected at runtime.
LD_LIBRARY_PATH = concatStringsSep ":" ( LD_LIBRARY_PATH = concatStringsSep ":" (
[ "${pkgs.xorg.libX11}/lib" "${pkgs.xorg.libXext}/lib" ] [ "${pkgs.xorg.libX11}/lib" "${pkgs.xorg.libXext}/lib" ]
++ concatLists (catAttrs "libPath" config.services.xserver.drivers)); ++ concatLists (catAttrs "libPath" xcfg.drivers));
}; };
serviceConfig = { serviceConfig = {
SyslogIdentifier = "xserver"; SyslogIdentifier = "xserver";
ExecReload = "${pkgs.coreutils}/bin/echo NOP"; ExecReload = "${pkgs.coreutils}/bin/echo NOP";
ExecStart = toString [ ExecStart = toString [
"${pkgs.xorg.xorgserver}/bin/X" "${pkgs.xorg.xorgserver}/bin/X"
":${toString config.services.xserver.display}" ":${toString xcfg.display}"
"vt${toString config.services.xserver.tty}" "vt${toString xcfg.tty}"
"-config ${import ./xserver.conf.nix args}" "-config ${import ./xserver.conf.nix args}"
"-logfile /dev/null -logverbose 0 -verbose 3" "-logfile /dev/null -logverbose 0 -verbose 3"
"-nolisten tcp" "-nolisten tcp"
"-xkbdir ${pkgs.xkeyboard_config}/etc/X11/xkb" "-xkbdir ${pkgs.xkeyboard_config}/etc/X11/xkb"
(optional (xcfg.dpi != null) "-dpi ${toString xcfg.dpi}")
]; ];
}; };
}; };
services.xresources.resources.dpi = ''
${optionalString (xcfg.dpi != null) "Xft.dpi: ${toString xcfg.dpi}"}
'';
systemd.services.urxvtd = { systemd.services.urxvtd = {
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
reloadIfChanged = true; reloadIfChanged = true;