From 47dbc30365f95fb5f3fe4ae963b013305b392518 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(+) diff --git a/modules/urxvtd.nix b/modules/urxvtd.nix index 3f3fee1..7eb471e 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