From d65277c9a3df97be8af39fb370e1c560e61011e1 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 7 Apr 2015 20:47:56 +0200 Subject: module urxvtd: add option xresources --- modules/urxvtd.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'modules') diff --git a/modules/urxvtd.nix b/modules/urxvtd.nix index 3f3fee157..7eb471ed9 100644 --- a/modules/urxvtd.nix +++ b/modules/urxvtd.nix @@ -1,5 +1,10 @@ { config, lib, pkgs, ... }: +let + inherit (import ../lib { inherit pkgs; }) shell-escape; + inherit (pkgs) writeScript; +in + with builtins; with lib; @@ -21,6 +26,13 @@ with lib; default = pkgs.rxvt_unicode; 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"; wantedBy = [ "multi-user.target" ]; restartIfChanged = false; + path = [ pkgs.xlibs.xrdb ]; environment = { + DISPLAY = ":0"; URXVT_PERL_LIB = "${urxvt}/lib/urxvt/perl"; }; serviceConfig = { Restart = "always"; User = user; + ExecStartPre = writeScript "urxvtd-prestart" '' + #!/bin/sh + echo ${shell-escape cfg.xresources} | xrdb -merge + ''; ExecStart = "${urxvt}/bin/urxvtd"; }; }; -- cgit v1.2.3