From c24deeca64538dcbc589ed8da9146e4ca9eb85b7 Mon Sep 17 00:00:00 2001 From: Paul Stadig Date: Mon, 3 Jul 2023 14:34:42 -0400 Subject: [PATCH] xfconf: remove properties with null values (#4192) Co-authored-by: Paul Stadig --- modules/misc/xfconf.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/misc/xfconf.nix b/modules/misc/xfconf.nix index ab21a66b..f9858c5f 100644 --- a/modules/misc/xfconf.nix +++ b/modules/misc/xfconf.nix @@ -76,7 +76,7 @@ in { settings = mkOption { type = with types; # xfIntVariant must come AFTER str; otherwise strings are treated as submodule imports... - let value = oneOf [ bool int float str xfIntVariant ]; + let value = nullOr (oneOf [ bool int float str xfIntVariant ]); in attrsOf (attrsOf (either value (listOf value))) // { description = "xfconf settings"; }; @@ -108,8 +108,11 @@ in { mkCommand = channel: property: value: '' $DRY_RUN_CMD ${pkgs.xfce.xfconf}/bin/xfconf-query \ ${ - escapeShellArgs - ([ "-n" "-c" channel "-p" "/${property}" ] ++ withType value) + escapeShellArgs ([ "-c" channel "-p" "/${property}" ] + ++ (if value == null then + [ "-r" ] + else + [ "-n" ] ++ withType value)) } '';