diff options
author | Lenz Weber <mail@lenzw.de> | 2018-03-25 14:59:05 +0200 |
---|---|---|
committer | Lenz Weber <mail@lenzw.de> | 2018-03-26 21:10:32 +0200 |
commit | 7c9278bd92a067832c421e79f25401a9791aaddd (patch) | |
tree | 388af2af27fc2ab4522749b5d8965ce3b295bd7b /modules/xresources.nix | |
parent | 4205c91609d6309ebbcddfa675fc63937718c14b (diff) |
xresources: add option extraConfig
Diffstat (limited to '')
-rw-r--r-- | modules/xresources.nix | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/modules/xresources.nix b/modules/xresources.nix index 8608438065f..634314f3ae9 100644 --- a/modules/xresources.nix +++ b/modules/xresources.nix @@ -28,17 +28,40 @@ in "Emacs*toolBar" = 0; }; description = '' - X server resources that should be set. If <code>null</code>, - then this feature is disabled and no + X server resources that should be set. + If this and all other xresources options are + <code>null</code>, then this feature is disabled and no + <filename>~/.Xresources</filename> link is produced. + ''; + }; + + xresources.extraConfig = mkOption { + type = types.lines; + default = ""; + example = literalExample '' + builtins.readFile ( + pkgs.fetchFromGitHub { + owner = "solarized"; + repo = "xresources"; + rev = "025ceddbddf55f2eb4ab40b05889148aab9699fc"; + sha256 = "0lxv37gmh38y9d3l8nbnsm1mskcv10g3i83j0kac0a2qmypv1k9f"; + } + "/Xresources.dark" + ) + ''; + description = '' + Additional X server resources contents. + If this and all other xresources options are + <code>null</code>, then this feature is disabled and no <filename>~/.Xresources</filename> link is produced. ''; }; }; - config = mkIf (cfg.properties != null) { + config = mkIf (cfg.properties != null || cfg.extraConfig != "") { home.file.".Xresources".text = - concatStringsSep "\n" ( - mapAttrsToList formatLine cfg.properties + concatStringsSep "\n" ([] + ++ (optional (cfg.extraConfig != "") cfg.extraConfig) + ++ (optionals (cfg.properties != null) (mapAttrsToList formatLine cfg.properties)) ) + "\n"; }; } |