summary refs log tree commit diff
diff options
context:
space:
mode:
authorTim Steinbach <tim@nequissimus.com>2019-01-07 07:35:20 -0500
committerTim Steinbach <tim@nequissimus.com>2019-01-07 07:35:20 -0500
commit289fe57eea6a2b3c9b5fa37b7c1cc6097e9466e0 (patch)
treec02d6da2b9c8c105b8585be4c9503d5593deb917
parentfa17392fd81381dae9e2b299520be213a52a36be (diff)
downloadnixpkgs-289fe57eea6a2b3c9b5fa37b7c1cc6097e9466e0.tar
nixpkgs-289fe57eea6a2b3c9b5fa37b7c1cc6097e9466e0.tar.gz
nixpkgs-289fe57eea6a2b3c9b5fa37b7c1cc6097e9466e0.tar.bz2
nixpkgs-289fe57eea6a2b3c9b5fa37b7c1cc6097e9466e0.tar.lz
nixpkgs-289fe57eea6a2b3c9b5fa37b7c1cc6097e9466e0.tar.xz
nixpkgs-289fe57eea6a2b3c9b5fa37b7c1cc6097e9466e0.tar.zst
nixpkgs-289fe57eea6a2b3c9b5fa37b7c1cc6097e9466e0.zip
urxvt: Allow switching out package
-rw-r--r--nixos/modules/services/x11/urxvtd.nix28
1 files changed, 19 insertions, 9 deletions
diff --git a/nixos/modules/services/x11/urxvtd.nix b/nixos/modules/services/x11/urxvtd.nix
index 5531d7f153c..d916fa5bb39 100644
--- a/nixos/modules/services/x11/urxvtd.nix
+++ b/nixos/modules/services/x11/urxvtd.nix
@@ -7,14 +7,24 @@ 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".
+      '';
+    };
 
-  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 {
@@ -24,14 +34,14 @@ in {
       partOf = [ "graphical-session.target" ];
       path = [ pkgs.xsel ];
       serviceConfig = {
-        ExecStart = "${pkgs.rxvt_unicode-with-plugins}/bin/urxvtd -o";
+        ExecStart = "${cfg.package}/bin/urxvtd -o";
         Environment = "RXVT_SOCKET=%t/urxvtd-socket";
         Restart = "on-failure";
         RestartSec = "5s";
       };
     };
 
-    environment.systemPackages = [ pkgs.rxvt_unicode-with-plugins ];
+    environment.systemPackages = [ cfg.package ];
     environment.variables.RXVT_SOCKET = "/run/user/$(id -u)/urxvtd-socket";
   };