1{
2 config,
3 lib,
4 pkgs,
5 ...
6}:
7
8# maintainer: siddharthist
9
10with lib;
11
12let
13 cfg = config.services.urxvtd;
14in
15{
16 options.services.urxvtd = {
17 enable = mkOption {
18 type = types.bool;
19 default = false;
20 description = ''
21 Enable urxvtd, the urxvt terminal daemon. To use urxvtd, run
22 "urxvtc".
23 '';
24 };
25
26 package = mkPackageOption pkgs "rxvt-unicode" { };
27 };
28
29 config = mkIf cfg.enable {
30 systemd.user.services.urxvtd = {
31 description = "urxvt terminal daemon";
32 wantedBy = [ "graphical-session.target" ];
33 partOf = [ "graphical-session.target" ];
34 path = [ pkgs.xsel ];
35 serviceConfig = {
36 ExecStart = "${cfg.package}/bin/urxvtd -o";
37 Environment = "RXVT_SOCKET=%t/urxvtd-socket";
38 Restart = "on-failure";
39 RestartSec = "5s";
40 };
41 };
42
43 environment.systemPackages = [ cfg.package ];
44 environment.variables.RXVT_SOCKET = "/run/user/$(id -u)/urxvtd-socket";
45 };
46
47 meta.maintainers = with lib.maintainers; [ rnhmjoj ];
48
49}