nixpkgs/nixos/modules/services/x11/urxvtd.nix
h7x4 0a37316d6c
treewide: use mkPackageOption
This commit replaces a lot of usages of `mkOption` with the package
type, to be `mkPackageOption`, in order to reduce the amount of code.
2023-11-27 01:28:36 +01:00

44 lines
1.0 KiB
Nix

{ config, lib, pkgs, ... }:
# maintainer: siddharthist
with lib;
let
cfg = config.services.urxvtd;
in {
options.services.urxvtd = {
enable = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
Enable urxvtd, the urxvt terminal daemon. To use urxvtd, run
"urxvtc".
'';
};
package = mkPackageOption pkgs "rxvt-unicode" { };
};
config = mkIf cfg.enable {
systemd.user.services.urxvtd = {
description = "urxvt terminal daemon";
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
path = [ pkgs.xsel ];
serviceConfig = {
ExecStart = "${cfg.package}/bin/urxvtd -o";
Environment = "RXVT_SOCKET=%t/urxvtd-socket";
Restart = "on-failure";
RestartSec = "5s";
};
};
environment.systemPackages = [ cfg.package ];
environment.variables.RXVT_SOCKET = "/run/user/$(id -u)/urxvtd-socket";
};
meta.maintainers = with lib.maintainers; [ rnhmjoj ];
}