xfconf: remove properties with null values (#4192)

Co-authored-by: Paul Stadig <paul@thoughtfull.systems>
This commit is contained in:
Paul Stadig 2023-07-03 14:34:42 -04:00 committed by GitHub
parent 8c66b46a86
commit c24deeca64
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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))
}
'';