module urxvtd: add option xresources

This commit is contained in:
lassulus 2015-04-07 20:47:56 +02:00 committed by tv
parent d540df1d38
commit d65277c9a3

View File

@ -1,5 +1,10 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let
inherit (import ../lib { inherit pkgs; }) shell-escape;
inherit (pkgs) writeScript;
in
with builtins; with builtins;
with lib; with lib;
@ -21,6 +26,13 @@ with lib;
default = pkgs.rxvt_unicode; default = pkgs.rxvt_unicode;
description = "urxvt package to use"; description = "urxvt package to use";
}; };
xresources = mkOption {
type = types.string;
default = "";
description = ''
X server resources for urxvt.
'';
};
}; };
}; };
@ -33,12 +45,18 @@ with lib;
description = "urxvt terminal daemon"; description = "urxvt terminal daemon";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
restartIfChanged = false; restartIfChanged = false;
path = [ pkgs.xlibs.xrdb ];
environment = { environment = {
DISPLAY = ":0";
URXVT_PERL_LIB = "${urxvt}/lib/urxvt/perl"; URXVT_PERL_LIB = "${urxvt}/lib/urxvt/perl";
}; };
serviceConfig = { serviceConfig = {
Restart = "always"; Restart = "always";
User = user; User = user;
ExecStartPre = writeScript "urxvtd-prestart" ''
#!/bin/sh
echo ${shell-escape cfg.xresources} | xrdb -merge
'';
ExecStart = "${urxvt}/bin/urxvtd"; ExecStart = "${urxvt}/bin/urxvtd";
}; };
}; };