11.stylix/modules/wpaperd/hm.nix
awwpotato 0e7b897c73
flake: update all inputs (#1881)
Update all inputs, rename the KDE platform, and apply formatter changes
by running the following commands:

    biome check --unsafe --write
    pre-commit run --all-files

Rename the KDE platform, following local commit f47c0edcf7 ("treewide:
remove Plasma 5 support dropped upstream (#1860)") and upstream commits
[1] ("nixos/treewide: clean up some more references to deleted qt5
things") and [2] ("qt: deprecate kde6").

[1]: 31d5c4e753
[2]: 1e759786e5

Closes: https://github.com/nix-community/stylix/issues/1865
Link: https://github.com/nix-community/stylix/pull/1866
Link: https://github.com/nix-community/stylix/pull/1881

Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
Co-authored-by: Samuel Meenzen <samuel@meenzen.net>
Co-authored-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
Reviewed-by: Daniel Thwaites <danth@danth.me>
2025-09-05 22:22:06 +02:00

33 lines
846 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;
}
);
}