From 543494b815f7370c8ba61b69607514fdf5abca95 Mon Sep 17 00:00:00 2001 From: Langston Barrett Date: Mon, 12 Sep 2016 01:00:36 +0000 Subject: [PATCH] urxvtd service: init adds pkgs.rxvt_unicode-with-plugins adds appropriate environment.variables no default target, must be enabled manually --- nixos/modules/module-list.nix | 1 + nixos/modules/services/x11/urxvtd.nix | 49 +++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 nixos/modules/services/x11/urxvtd.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index d1a786d8f62..7acd4d0f033 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -515,6 +515,7 @@ ./services/x11/hardware/synaptics.nix ./services/x11/hardware/wacom.nix ./services/x11/redshift.nix + ./services/x11/urxvtd.nix ./services/x11/window-managers/awesome.nix #./services/x11/window-managers/compiz.nix ./services/x11/window-managers/default.nix diff --git a/nixos/modules/services/x11/urxvtd.nix b/nixos/modules/services/x11/urxvtd.nix new file mode 100644 index 00000000000..ab47f4547ae --- /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"; + }; + +}