diff options
author | jeschli <jeschli@gmail.com> | 2019-04-28 15:05:34 +0200 |
---|---|---|
committer | jeschli <jeschli@gmail.com> | 2019-04-28 15:05:34 +0200 |
commit | e45b3492b3961685936378a160adb225789e51d9 (patch) | |
tree | cc0480e485ab78d1f52f80ec36987b9a57e925f7 /tv/3modules | |
parent | 97d4f9a771a9bbb1b45085569028db2d7dfbd610 (diff) | |
parent | 915e4b843790d3e71bdccea124d4832ca042e456 (diff) |
Merge branch 'master' of prism.r:stockholm
Diffstat (limited to 'tv/3modules')
-rw-r--r-- | tv/3modules/Xresources.nix | 39 | ||||
-rw-r--r-- | tv/3modules/default.nix | 1 |
2 files changed, 40 insertions, 0 deletions
diff --git a/tv/3modules/Xresources.nix b/tv/3modules/Xresources.nix new file mode 100644 index 000000000..983b8bc2e --- /dev/null +++ b/tv/3modules/Xresources.nix @@ -0,0 +1,39 @@ +with import <stockholm/lib>; +{ config, pkgs, ... }: let + cfg = { + enable = config.tv.Xresources != {}; + user = config.krebs.build.user; + }; +in { + options.tv.Xresources = mkOption { + default = {}; + type = types.attrsOf types.str; + }; + config = { + nixpkgs.overlays = singleton (self: super: { + tv = super.tv or {} // { + Xresources = + self.writeText "Xresources" + (concatStrings (mapAttrsToList (name: value: /* xdefaults */ '' + ${name}: ${value} + '') config.tv.Xresources)); + }; + }); + systemd.services.${if cfg.enable then "Xresources" else null} = { + wantedBy = [ "graphical.target" ]; + after = [ "xserver.service" ]; + requires = [ "xserver.service" ]; + environment = { + DISPLAY = ":${toString config.services.xserver.display}"; + }; + serviceConfig = { + ExecStart = "${pkgs.xorg.xrdb}/bin/xrdb ${pkgs.tv.Xresources}"; + RemainAfterExit = true; + SyslogIdentifier = "Xresources"; + Type = "oneshot"; + User = cfg.user.name; + WorkingDirectory = cfg.user.home; + }; + }; + }; +} diff --git a/tv/3modules/default.nix b/tv/3modules/default.nix index 67fb3f650..edaf50f03 100644 --- a/tv/3modules/default.nix +++ b/tv/3modules/default.nix @@ -7,5 +7,6 @@ ./iptables.nix ./slock.nix ./x0vncserver.nix + ./Xresources.nix ]; } |