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