11.stylix/modules/regreet/nixos.nix
Devin a2d66f2547
treewide: extend stylix.imageScalingMode support
Add stylix.imageScalingMode support to all modules except:

- hyprlock
- hyprpaper
- kde
- lightdm
- sway

Closes: https://github.com/danth/stylix/issues/677
Link: https://github.com/danth/stylix/pull/678

Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
Reviewed-by: Daniel Thwaites <danth@danth.me>
2024-12-18 15:15:36 +01:00

46 lines
1.2 KiB
Nix

{
pkgs,
config,
lib,
...
}:
{
options.stylix.targets.regreet.enable = config.lib.stylix.mkEnableTarget "ReGreet" true;
config =
lib.mkIf
(config.stylix.enable && config.stylix.targets.regreet.enable && pkgs.stdenv.hostPlatform.isLinux)
{
programs.regreet = {
settings.background = {
path = config.stylix.image;
fit = let
inherit (config.stylix) imageScalingMode;
in
if imageScalingMode == "fill"
then "Cover"
else if imageScalingMode == "fit"
then "Contain"
else if imageScalingMode == "stretch"
then "Fill"
# No other available options
else null;
};
font = {
inherit (config.stylix.fonts.sansSerif) name package;
};
cursorTheme = {
inherit (config.stylix.cursor) name package;
};
theme = {
package = pkgs.adw-gtk3;
name = "adw-gtk3";
};
extraCss = config.lib.stylix.colors {
template = ./../gtk/gtk.mustache;
extension = "css";
};
};
};
}