2016-09-12 01:00:36 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
# maintainer: siddharthist
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.urxvtd;
|
|
|
|
in {
|
2019-01-07 12:35:20 +00:00
|
|
|
options.services.urxvtd = {
|
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
Enable urxvtd, the urxvt terminal daemon. To use urxvtd, run
|
|
|
|
"urxvtc".
|
|
|
|
'';
|
|
|
|
};
|
2016-09-12 01:00:36 +00:00
|
|
|
|
2019-01-07 12:35:20 +00:00
|
|
|
package = mkOption {
|
2020-02-13 08:33:58 +00:00
|
|
|
default = pkgs.rxvt-unicode;
|
2021-10-03 16:06:03 +00:00
|
|
|
defaultText = literalExpression "pkgs.rxvt-unicode";
|
2019-01-07 12:35:20 +00:00
|
|
|
description = ''
|
2020-02-13 08:33:58 +00:00
|
|
|
Package to install. Usually pkgs.rxvt-unicode.
|
2019-01-07 12:35:20 +00:00
|
|
|
'';
|
|
|
|
type = types.package;
|
|
|
|
};
|
2016-09-12 01:00:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2018-11-25 07:17:25 +00:00
|
|
|
systemd.user.services.urxvtd = {
|
|
|
|
description = "urxvt terminal daemon";
|
|
|
|
wantedBy = [ "graphical-session.target" ];
|
|
|
|
partOf = [ "graphical-session.target" ];
|
|
|
|
path = [ pkgs.xsel ];
|
|
|
|
serviceConfig = {
|
2019-01-07 12:35:20 +00:00
|
|
|
ExecStart = "${cfg.package}/bin/urxvtd -o";
|
2018-11-25 07:17:25 +00:00
|
|
|
Environment = "RXVT_SOCKET=%t/urxvtd-socket";
|
|
|
|
Restart = "on-failure";
|
|
|
|
RestartSec = "5s";
|
2016-09-12 01:00:36 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2019-01-07 12:35:20 +00:00
|
|
|
environment.systemPackages = [ cfg.package ];
|
2016-09-12 01:00:36 +00:00
|
|
|
environment.variables.RXVT_SOCKET = "/run/user/$(id -u)/urxvtd-socket";
|
|
|
|
};
|
|
|
|
|
2019-12-04 16:07:45 +00:00
|
|
|
meta.maintainers = with lib.maintainers; [ rnhmjoj ];
|
|
|
|
|
2016-09-12 01:00:36 +00:00
|
|
|
}
|