11.stylix/modules/wpaperd/hm.nix
NAHO 218d4424b0
treewide: remove redundant stylix.image Nix store copies (#1659)
Link: https://github.com/nix-community/stylix/pull/1659

Tested-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
Reviewed-by: awwpotato <awwpotato@voidq.com>
2025-07-13 15:21:22 -07:00

32 lines
838 B
Nix

{ mkTarget, lib, ... }:
mkTarget {
name = "wpaperd";
humanName = "wpaperd";
configElements =
{ imageScalingMode, image }:
(
let
# wpaperd doesn't have any mode close to the described behavior of center
modeMap = {
"stretch" = "stretch";
# wpaperd's center mode is closest to the described behavior of fill
"fill" = "center";
"fit" = "fit";
"tile" = "tile";
};
modeAttrs =
if builtins.hasAttr imageScalingMode modeMap then
{ mode = modeMap.${imageScalingMode}; }
else
lib.info "stylix: wpaperd: unsupported image scaling mode: ${imageScalingMode}"
{ };
in
{
services.wpaperd.settings.any = {
path = image;
} // modeAttrs;
}
);
}