2017-01-12 00:01:15 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.xresources;
|
|
|
|
|
|
|
|
formatLine = n: v:
|
|
|
|
let
|
|
|
|
v' =
|
|
|
|
if isBool v then (if v then "true" else "false")
|
|
|
|
else toString v;
|
|
|
|
in
|
|
|
|
"${n}: ${v'}";
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
xresources.properties = mkOption {
|
|
|
|
type = types.nullOr types.attrs;
|
|
|
|
default = null;
|
2017-01-15 19:03:55 +00:00
|
|
|
example = {
|
|
|
|
"XTerm*faceName" = "dejavu sans mono";
|
|
|
|
"Emacs*toolBar" = 0;
|
|
|
|
};
|
2017-01-12 00:01:15 +00:00
|
|
|
description = ''
|
2017-01-15 19:03:55 +00:00
|
|
|
X server resources that should be set. If <code>null</code>,
|
|
|
|
then this feature is disabled and no
|
|
|
|
<filename>~/.Xresources</filename> link is produced.
|
2017-01-12 00:01:15 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf (cfg.properties != null) {
|
|
|
|
home.file.".Xresources".text =
|
|
|
|
concatStringsSep "\n" (
|
|
|
|
mapAttrsToList formatLine cfg.properties
|
2017-01-13 00:12:26 +00:00
|
|
|
) + "\n";
|
2017-01-12 00:01:15 +00:00
|
|
|
};
|
|
|
|
}
|