11.stylix/modules/wayfire/hm.nix
NAHO ce22070ec5
Some checks failed
Label Merge Conflicts / conflicts (push) Has been cancelled
Documentation / docs (push) Has been cancelled
treewide: deprecate manual targets.${target}.useWallpaper.enable options (#2084)
Deprecate manual targets.${target}.useWallpaper.enable options with
generated targets.${target}.image.enable options, following commit
953c3fb01e ("stylix/mk-target: generate options for configuring
safeguarded arguments").

Link: https://github.com/nix-community/stylix/pull/2084

Reviewed-by: 0xda157 <da157@voidq.com>
2026-02-01 21:43:25 +01:00

100 lines
2.3 KiB
Nix

{
mkTarget,
lib,
pkgs,
...
}:
mkTarget {
imports = [
(lib.mkRenamedOptionModuleWith {
from = [
"stylix"
"targets"
"wayfire"
"useWallpaper"
];
sinceRelease = 2605;
to = [
"stylix"
"targets"
"wayfire"
"image"
"enable"
];
})
];
config = [
(
{ fonts }:
{
wayland.windowManager.wayfire.settings.decoration.font =
"${fonts.monospace.name} ${toString fonts.sizes.desktop}";
}
)
(
{ image, imageScalingMode }:
let
wayfireBackground = pkgs.runCommand "wayfire-background.png" { } ''
${lib.getExe' pkgs.imagemagick "convert"} ${image} $out
'';
in
{
wayland.windowManager.wayfire.settings = {
cube = {
cubemap_image = wayfireBackground;
skydome_texture = wayfireBackground;
};
};
wayland.windowManager.wayfire.wf-shell.settings = {
background.image = wayfireBackground;
background.fill_mode =
if imageScalingMode == "stretch" then
"stretch"
else if imageScalingMode == "fit" then
"preserve_aspect"
else
"fill_and_crop";
};
}
)
(
{ targets }:
{
wayland.windowManager.wayfire.wf-shell.settings.panel.menu_icon =
lib.mkIf targets.nixos-icons.enable "${pkgs.nixos-icons}/share/icons/hicolor/256x256/apps/nix-snowflake.png";
}
)
(
{ colors }:
let
rgba = rgb: a: "\\#${rgb}${a}";
rgb = (lib.flip rgba) "ff";
in
{
wayland.windowManager.wayfire = {
settings = {
cube = {
background = rgb colors.base00;
};
expo.background = rgb colors.base00;
vswitch.background = rgb colors.base00;
vswipe.background = rgb colors.base00;
core.background_color = rgb colors.base00;
decoration = {
active_color = rgb colors.base0D;
inactive_color = rgb colors.base03;
};
};
wf-shell.settings = {
panel.background_color = rgb colors.base01;
};
};
}
)
];
}