summaryrefslogtreecommitdiffstats
path: root/lass/3modules/urxvtd.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2015-07-29 14:56:06 +0200
committermakefu <github@syntax-fehler.de>2015-07-29 14:56:06 +0200
commit0bf2b871dda30231443324588ab8142e125e9774 (patch)
tree0646d45eab135eb2c7d8665c31d7ac135e29afff /lass/3modules/urxvtd.nix
parent671710c573980d859cb82993cd0514058a63262f (diff)
parent1bf670270c1e87900a908f7e9b949b5502158f4f (diff)
merge cloudkrebs, fix path to krebs/4lib
Diffstat (limited to 'lass/3modules/urxvtd.nix')
-rw-r--r--lass/3modules/urxvtd.nix55
1 files changed, 55 insertions, 0 deletions
diff --git a/lass/3modules/urxvtd.nix b/lass/3modules/urxvtd.nix
new file mode 100644
index 000000000..469616a9f
--- /dev/null
+++ b/lass/3modules/urxvtd.nix
@@ -0,0 +1,55 @@
+{ config, lib, pkgs, ... }:
+
+let
+in
+
+with builtins;
+with lib;
+
+{
+ options = {
+ services.urxvtd = {
+ enable = mkOption {
+ type = types.bool;
+ default = false;
+ description = "Enable urxvtd per user";
+ };
+ users = mkOption {
+ type = types.listOf types.string;
+ default = [];
+ description = "users to run urxvtd for";
+ };
+ urxvtPackage = mkOption {
+ type = types.package;
+ default = pkgs.rxvt_unicode;
+ description = "urxvt package to use";
+ };
+ };
+ };
+
+ config =
+ let
+ cfg = config.services.urxvtd;
+ users = cfg.users;
+ urxvt = cfg.urxvtPackage;
+ mkService = user: {
+ description = "urxvt terminal daemon";
+ wantedBy = [ "multi-user.target" ];
+ restartIfChanged = false;
+ path = [ pkgs.xlibs.xrdb ];
+ environment = {
+ DISPLAY = ":0";
+ URXVT_PERL_LIB = "${urxvt}/lib/urxvt/perl";
+ };
+ serviceConfig = {
+ Restart = "always";
+ User = user;
+ ExecStart = "${urxvt}/bin/urxvtd";
+ };
+ };
+ in
+ mkIf cfg.enable {
+ environment.systemPackages = [ urxvt ];
+ systemd.services = listToAttrs (map (u: { name = "${u}-urxvtd"; value = mkService u; }) users);
+ };
+}