aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/nixos/modules/services/x11/urxvtd.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/modules/services/x11/urxvtd.nix')
-rw-r--r--nixpkgs/nixos/modules/services/x11/urxvtd.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/nixpkgs/nixos/modules/services/x11/urxvtd.nix b/nixpkgs/nixos/modules/services/x11/urxvtd.nix
new file mode 100644
index 00000000000..d916fa5bb39
--- /dev/null
+++ b/nixpkgs/nixos/modules/services/x11/urxvtd.nix
@@ -0,0 +1,48 @@
+{ config, lib, pkgs, ... }:
+
+# maintainer: siddharthist
+
+with lib;
+
+let
+ cfg = config.services.urxvtd;
+in {
+ options.services.urxvtd = {
+ enable = mkOption {
+ type = types.bool;
+ default = false;
+ description = ''
+ Enable urxvtd, the urxvt terminal daemon. To use urxvtd, run
+ "urxvtc".
+ '';
+ };
+
+ 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";
+ 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";
+ };
+
+}