1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-05 01:19:46 +01:00

xresources: Add path configuration option (#2141)

* xresources: Add path configuration option

This allows the user to move .Xresources somewhere else, which can help
with decluttering the home directory.

* xresources: Update xresources.path docs

* xresources: Fix formatting

(cherry picked from commit dc4337d9fe)
This commit is contained in:
Lava 2021-06-28 13:50:40 +07:00 committed by Robert Helgesson
parent 68ec2dd609
commit 49695f33aa
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -23,7 +23,7 @@ let
toString v;
in "${n}: ${formatValue v}";
xrdbMerge = "${pkgs.xorg.xrdb}/bin/xrdb -merge ~/.Xresources";
xrdbMerge = "${pkgs.xorg.xrdb}/bin/xrdb -merge ${cfg.path}";
in {
meta.maintainers = [ maintainers.rycee ];
@ -75,11 +75,19 @@ in {
<filename>~/.Xresources</filename> link is produced.
'';
};
xresources.path = mkOption {
type = types.str;
default = "${config.home.homeDirectory}/.Xresources";
defaultText = "$HOME/.Xresources";
description =
"Path where Home Manager should link the <filename>.Xresources</filename> file.";
};
};
config = mkIf ((cfg.properties != null && cfg.properties != { })
|| cfg.extraConfig != "") {
home.file.".Xresources" = {
home.file.${cfg.path} = {
text = concatStringsSep "\n" ([ ]
++ optional (cfg.extraConfig != "") cfg.extraConfig
++ optionals (cfg.properties != null)