diff options
author | tv <tv@shackspace.de> | 2015-07-11 19:44:12 +0200 |
---|---|---|
committer | tv <tv@shackspace.de> | 2015-07-11 19:44:12 +0200 |
commit | 2bc5c58d85990e483af8fde57ed5f2442351b69c (patch) | |
tree | 94cd29e6a98f1ce6228104055d0550e318242290 /old/modules/lass/urxvtd.nix | |
parent | c5fcda1390afaba71133b2ee6ac1ddd0f559ef8c (diff) |
move old stuff
Diffstat (limited to 'old/modules/lass/urxvtd.nix')
-rw-r--r-- | old/modules/lass/urxvtd.nix | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/old/modules/lass/urxvtd.nix b/old/modules/lass/urxvtd.nix new file mode 100644 index 000000000..469616a9f --- /dev/null +++ b/old/modules/lass/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); + }; +} |