urxvt: Allow switching out package

This commit is contained in:
Tim Steinbach 2019-01-07 07:35:20 -05:00
parent fa17392fd8
commit 289fe57eea
No known key found for this signature in database
GPG Key ID: 472BFCCA96BD0EDA

View File

@ -7,14 +7,24 @@ with lib;
let
cfg = config.services.urxvtd;
in {
options.services.urxvtd = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Enable urxvtd, the urxvt terminal daemon. To use urxvtd, run
"urxvtc".
'';
};
options.services.urxvtd.enable = mkOption {
type = types.bool;
default = false;
description = ''
Enable urxvtd, the urxvt terminal daemon. To use urxvtd, run
"urxvtc".
'';
package = mkOption {
default = pkgs.rxvt_unicode-with-plugins;
defaultText = "pkgs.rxvt_unicode-with-plugins";
description = ''
Package to install. Usually pkgs.rxvt_unicode-with-plugins or pkgs.rxvt_unicode
'';
type = types.package;
};
};
config = mkIf cfg.enable {
@ -24,14 +34,14 @@ in {
partOf = [ "graphical-session.target" ];
path = [ pkgs.xsel ];
serviceConfig = {
ExecStart = "${pkgs.rxvt_unicode-with-plugins}/bin/urxvtd -o";
ExecStart = "${cfg.package}/bin/urxvtd -o";
Environment = "RXVT_SOCKET=%t/urxvtd-socket";
Restart = "on-failure";
RestartSec = "5s";
};
};
environment.systemPackages = [ pkgs.rxvt_unicode-with-plugins ];
environment.systemPackages = [ cfg.package ];
environment.variables.RXVT_SOCKET = "/run/user/$(id -u)/urxvtd-socket";
};