mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 14:40:29 +00: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
This commit is contained in:
parent
a17bc3217f
commit
dc4337d9fe
1 changed files with 10 additions and 2 deletions
|
@ -23,7 +23,7 @@ let
|
||||||
toString v;
|
toString v;
|
||||||
in "${n}: ${formatValue v}";
|
in "${n}: ${formatValue v}";
|
||||||
|
|
||||||
xrdbMerge = "${pkgs.xorg.xrdb}/bin/xrdb -merge ~/.Xresources";
|
xrdbMerge = "${pkgs.xorg.xrdb}/bin/xrdb -merge ${cfg.path}";
|
||||||
|
|
||||||
in {
|
in {
|
||||||
meta.maintainers = [ maintainers.rycee ];
|
meta.maintainers = [ maintainers.rycee ];
|
||||||
|
@ -75,11 +75,19 @@ in {
|
||||||
<filename>~/.Xresources</filename> link is produced.
|
<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 != { })
|
config = mkIf ((cfg.properties != null && cfg.properties != { })
|
||||||
|| cfg.extraConfig != "") {
|
|| cfg.extraConfig != "") {
|
||||||
home.file.".Xresources" = {
|
home.file.${cfg.path} = {
|
||||||
text = concatStringsSep "\n" ([ ]
|
text = concatStringsSep "\n" ([ ]
|
||||||
++ optional (cfg.extraConfig != "") cfg.extraConfig
|
++ optional (cfg.extraConfig != "") cfg.extraConfig
|
||||||
++ optionals (cfg.properties != null)
|
++ optionals (cfg.properties != null)
|
||||||
|
|
Loading…
Reference in a new issue