mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 17:39:37 +08:00
xresources: do not generate file for empty properties
This commit is contained in:
@@ -75,17 +75,18 @@ in {
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf (cfg.properties != null || cfg.extraConfig != "") {
|
||||
home.file.".Xresources" = {
|
||||
text = concatStringsSep "\n" ([ ]
|
||||
++ optional (cfg.extraConfig != "") cfg.extraConfig
|
||||
++ optionals (cfg.properties != null)
|
||||
(mapAttrsToList formatLine cfg.properties)) + "\n";
|
||||
onChange = ''
|
||||
if [[ -v DISPLAY ]] ; then
|
||||
$DRY_RUN_CMD ${pkgs.xorg.xrdb}/bin/xrdb -merge $HOME/.Xresources
|
||||
fi
|
||||
'';
|
||||
config = mkIf ((cfg.properties != null && cfg.properties != { })
|
||||
|| cfg.extraConfig != "") {
|
||||
home.file.".Xresources" = {
|
||||
text = concatStringsSep "\n" ([ ]
|
||||
++ optional (cfg.extraConfig != "") cfg.extraConfig
|
||||
++ optionals (cfg.properties != null)
|
||||
(mapAttrsToList formatLine cfg.properties)) + "\n";
|
||||
onChange = ''
|
||||
if [[ -v DISPLAY ]] ; then
|
||||
$DRY_RUN_CMD ${pkgs.xorg.xrdb}/bin/xrdb -merge $HOME/.Xresources
|
||||
fi
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1 +1,4 @@
|
||||
{ xresources = ./xresources.nix; }
|
||||
{
|
||||
xresources = ./xresources.nix;
|
||||
xresources-empty-properties = ./empty.nix;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user