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:
parent
68ec2dd609
commit
49695f33aa
1 changed files with 10 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue