summary refs log tree commit diff
path: root/nixos/modules/services/x11/urxvtd.nix
diff options
context:
space:
mode:
authorLangston Barrett <langston.barrett@gmail.com>2016-09-12 01:00:36 +0000
committerLangston Barrett <langston.barrett@gmail.com>2016-10-06 20:03:06 +0000
commit543494b815f7370c8ba61b69607514fdf5abca95 (patch)
tree5a6aabd8703482d34dd3c6825c3d0ae4033bee75 /nixos/modules/services/x11/urxvtd.nix
parent66d622fbd0f2561b841b629179ffb914eff8147f (diff)
downloadnixlib-543494b815f7370c8ba61b69607514fdf5abca95.tar
nixlib-543494b815f7370c8ba61b69607514fdf5abca95.tar.gz
nixlib-543494b815f7370c8ba61b69607514fdf5abca95.tar.bz2
nixlib-543494b815f7370c8ba61b69607514fdf5abca95.tar.lz
nixlib-543494b815f7370c8ba61b69607514fdf5abca95.tar.xz
nixlib-543494b815f7370c8ba61b69607514fdf5abca95.tar.zst
nixlib-543494b815f7370c8ba61b69607514fdf5abca95.zip
urxvtd service: init
adds pkgs.rxvt_unicode-with-plugins
adds appropriate environment.variables
no default target, must be enabled manually
Diffstat (limited to 'nixos/modules/services/x11/urxvtd.nix')
-rw-r--r--nixos/modules/services/x11/urxvtd.nix49
1 files changed, 49 insertions, 0 deletions
diff --git a/nixos/modules/services/x11/urxvtd.nix b/nixos/modules/services/x11/urxvtd.nix
new file mode 100644
index 000000000000..ab47f4547aea
--- /dev/null
+++ b/nixos/modules/services/x11/urxvtd.nix
@@ -0,0 +1,49 @@
+{ config, lib, pkgs, ... }:
+
+# maintainer: siddharthist
+
+with lib;
+
+let
+  cfg = config.services.urxvtd;
+in {
+
+  options.services.urxvtd.enable = mkOption {
+    type = types.bool;
+    default = false;
+    example = true;
+    description = ''
+      Enable urxvtd, the urxvt terminal daemon. To use urxvtd, run
+      "urxvtc".
+    '';
+  };
+
+  config = mkIf cfg.enable {
+    systemd.user = {
+      sockets.urxvtd = {
+        description = "socket for urxvtd, the urxvt terminal daemon";
+        after = [ "graphical.target" ];
+        wants = [ "graphical.target" ];
+        wantedBy = [ "sockets.target" ];
+        socketConfig = {
+          ListenStream = "%t/urxvtd-socket";
+        };
+      };
+
+      services.urxvtd = {
+        description = "urxvt terminal daemon";
+        serviceConfig = {
+          ExecStart = "${pkgs.rxvt_unicode-with-plugins}/bin/urxvtd -o";
+          Environment = "RXVT_SOCKET=%t/urxvtd-socket";
+          Restart = "on-failure";
+          RestartSec = "5s";
+        };
+      };
+
+    };
+
+    environment.systemPackages = [ pkgs.rxvt_unicode-with-plugins ];
+    environment.variables.RXVT_SOCKET = "/run/user/$(id -u)/urxvtd-socket";
+  };
+
+}