aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/xresources.nix25
-rw-r--r--tests/modules/xresources/default.nix5
2 files changed, 17 insertions, 13 deletions
diff --git a/modules/xresources.nix b/modules/xresources.nix
index e9e131352a6..dc59e50c46e 100644
--- a/modules/xresources.nix
+++ b/modules/xresources.nix
@@ -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
+ '';
+ };
};
- };
}
diff --git a/tests/modules/xresources/default.nix b/tests/modules/xresources/default.nix
index afd15fbd300..70b3e6b4a9c 100644
--- a/tests/modules/xresources/default.nix
+++ b/tests/modules/xresources/default.nix
@@ -1 +1,4 @@
-{ xresources = ./xresources.nix; }
+{
+ xresources = ./xresources.nix;
+ xresources-empty-properties = ./empty.nix;
+}