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,8 +7,8 @@ with lib;
let
cfg = config.services.urxvtd;
in {
options.services.urxvtd.enable = mkOption {
options.services.urxvtd = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
@ -17,6 +17,16 @@ in {
'';
};
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 {
systemd.user.services.urxvtd = {
description = "urxvt terminal daemon";
@ -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";
};