Skip to content

Commit

Permalink
kde: remove redundant null checks and prepare wallpaper option
Browse files Browse the repository at this point in the history
  • Loading branch information
rkuklik committed Jan 31, 2025
1 parent b5420bb commit cfe6826
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions modules/kde/hm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@ let
default: withImage:
let
satisfies = check: (check default) && (check withImage);
hasImage = image != null;
addImage = fn: fn hasImage withImage;
in
if !hasImage then
# TODO: when adding `wallpaper` option to this module, replace this with `image == null || !stylix.targets.kde.wallpaper`
if image == null then
default
else if satisfies lib.isString then
default + (addImage lib.optionalString)
default + withImage
else if satisfies lib.isAttrs then
default // (addImage lib.optionalAttrs)
default // withImage
else if satisfies lib.isList then
default ++ (addImage lib.optional)
default ++ withImage
else
throw "unreachable (image merge in stylix KDE module)";

Expand Down

0 comments on commit cfe6826

Please sign in to comment.