1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-27 05:29:46 +01:00

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 { settings = mkOption {
type = with types; type = with types;
# xfIntVariant must come AFTER str; otherwise strings are treated as submodule imports... # 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))) // { in attrsOf (attrsOf (either value (listOf value))) // {
description = "xfconf settings"; description = "xfconf settings";
}; };
@ -108,8 +108,11 @@ in {
mkCommand = channel: property: value: '' mkCommand = channel: property: value: ''
$DRY_RUN_CMD ${pkgs.xfce.xfconf}/bin/xfconf-query \ $DRY_RUN_CMD ${pkgs.xfce.xfconf}/bin/xfconf-query \
${ ${
escapeShellArgs escapeShellArgs ([ "-c" channel "-p" "/${property}" ]
([ "-n" "-c" channel "-p" "/${property}" ] ++ withType value) ++ (if value == null then
[ "-r" ]
else
[ "-n" ] ++ withType value))
} }
''; '';