Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions modules/gnome/hm.nix
Original file line number Diff line number Diff line change
@@ -1,23 +1,39 @@
{
mkTarget,
pkgs,
config,
lib,
...
}:
mkTarget {
imports = [
(lib.mkRenamedOptionModuleWith {
from = [
"stylix"
"targets"
"gnome"
"useWallpaper"
];
sinceRelease = 2605;
to = [
"stylix"
"targets"
"gnome"
"image"
"enable"
];
})
];

autoEnable = pkgs.stdenv.hostPlatform.isLinux;
autoEnableExpr = "pkgs.stdenv.hostPlatform.isLinux";

options.useWallpaper = config.lib.stylix.mkEnableWallpaper "GNOME" true;

config = [
(
{ cfg, image }:
{ image }:
{
dconf.settings."org/gnome/desktop/background" = {
picture-uri = lib.mkIf cfg.useWallpaper "file://${image}";
picture-uri-dark = lib.mkIf cfg.useWallpaper "file://${image}";
picture-uri = "file://${image}";
picture-uri-dark = "file://${image}";
};
}
)
Expand Down
32 changes: 21 additions & 11 deletions modules/hyprlock/hm.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
{
mkTarget,
config,
lib,
...
}:
{ mkTarget, lib, ... }:
mkTarget {
options.useWallpaper = config.lib.stylix.mkEnableWallpaper "Hyprlock" true;
imports = [
(lib.mkRenamedOptionModuleWith {
from = [
"stylix"
"targets"
"hyprlock"
"useWallpaper"
];
sinceRelease = 2605;
to = [
"stylix"
"targets"
"hyprlock"
"image"
"enable"
];
})
];

config = [
(
{ cfg, image }:
{ image }:
{
programs.hyprlock.settings.background.path = lib.mkIf cfg.useWallpaper "${
image
}";
programs.hyprlock.settings.background.path = image;
}
)
(
Expand Down
31 changes: 21 additions & 10 deletions modules/lightdm/nixos.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
{
mkTarget,
config,
lib,
...
}:
{ mkTarget, lib, ... }:
mkTarget {
options.useWallpaper = config.lib.stylix.mkEnableWallpaper "LightDM" true;
imports = [
(lib.mkRenamedOptionModuleWith {
from = [
"stylix"
"targets"
"lightdm"
"useWallpaper"
];
sinceRelease = 2605;
to = [
"stylix"
"targets"
"lightdm"
"image"
"enable"
];
})
];

config =
{ cfg, image }:
{ image }:
{
services.xserver.displayManager.lightdm.background =
lib.mkIf cfg.useWallpaper image;
services.xserver.displayManager.lightdm.background = image;
};
}
30 changes: 21 additions & 9 deletions modules/limine/nixos.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
{
mkTarget,
config,
lib,
...
}:
{ mkTarget, lib, ... }:
mkTarget {
options.useWallpaper = config.lib.stylix.mkEnableWallpaper "Limine" true;
imports = [
(lib.mkRenamedOptionModuleWith {
from = [
"stylix"
"targets"
"limine"
"useWallpaper"
];
sinceRelease = 2605;
to = [
"stylix"
"targets"
"limine"
"image"
"enable"
];
})
];

config = [
(
Expand All @@ -25,9 +37,9 @@ mkTarget {
}
)
(
{ cfg, image }:
{ image }:
{
boot.loader.limine.style.wallpapers = lib.mkIf cfg.useWallpaper [ image ];
boot.loader.limine.style.wallpapers = [ image ];
}
)
(
Expand Down
47 changes: 31 additions & 16 deletions modules/regreet/nixos.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,35 @@
...
}:
mkTarget {
imports = [
(lib.mkRenamedOptionModuleWith {
from = [
"stylix"
"targets"
"regreet"
"useWallpaper"
];
sinceRelease = 2605;
to = [
"stylix"
"targets"
"regreet"
"image"
"enable"
];
})
];

autoEnable = pkgs.stdenv.hostPlatform.isLinux;
autoEnableExpr = "pkgs.stdenv.hostPlatform.isLinux";

options = {
useWallpaper = config.lib.stylix.mkEnableWallpaper "ReGreet" true;
extraCss = lib.mkOption {
description = ''
Extra code added to `programs.regreet.extraCss` option.
'';
type = lib.types.lines;
default = "";
example = "window.background { border-radius: 0; }";
};
options.extraCss = lib.mkOption {
description = ''
Extra code added to `programs.regreet.extraCss` option.
'';
type = lib.types.lines;
default = "";
example = "window.background { border-radius: 0; }";
};

config = [
Expand Down Expand Up @@ -67,15 +83,15 @@ mkTarget {
}
)
(
{ cfg, image }:
{ image }:
{
programs.regreet.settings.background.path = lib.mkIf cfg.useWallpaper image;
programs.regreet.settings.background.path = image;
}
)
(
{ cfg, imageScalingMode }:
{ imageScalingMode }:
{
programs.regreet.settings.background.fit = lib.mkIf cfg.useWallpaper (
programs.regreet.settings.background.fit =
Copy link
Member Author

@trueNAHO trueNAHO Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike before, this change causes programs.regreet.settings.background.fit to be declared when targets.regreet.image.enable is enabled and targets.regreet.imageScalingMode.enable is disabled. Is this a safe change, assuming upstream should not access the background fitting type when there is no background? Otherwise, this group should be merged with the other { image } group into { image, imageScalingMode }.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like merging them would make more sense, setting the wallpaper scaling but not the wallpaper image seems silly.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like merging them would make more sense, setting the wallpaper scaling but not the wallpaper image seems silly.

Yes, but this makes this group artificially more restrictive than necessary. For example, the entire { image, imageScalingMode } group would be disabled when imageScalingMode is disabled, despite image being enabled and desired.

I would say this PR is ready to merge as-is.

if imageScalingMode == "fill" then
"Cover"
else if imageScalingMode == "fit" then
Expand All @@ -84,8 +100,7 @@ mkTarget {
"Fill"
# No other available options
else
null
);
null;
}
)
(
Expand Down
22 changes: 18 additions & 4 deletions modules/swaylock/hm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ mkTarget {
lib.versionAtLeast config.home.stateVersion "23.05" && pkgs.stdenv.hostPlatform.isLinux
'';

options.useWallpaper = config.lib.stylix.mkEnableWallpaper "Swaylock" true;

config = [
(
{ colors }:
Expand Down Expand Up @@ -66,9 +64,9 @@ mkTarget {
}
)
(
{ cfg, image }:
{ image }:
{
programs.swaylock.settings.image = lib.mkIf cfg.useWallpaper image;
programs.swaylock.settings.image = image;
}
)
(
Expand All @@ -94,5 +92,21 @@ mkTarget {
"useWallpaper"
];
})
(lib.mkRenamedOptionModuleWith {
from = [
"stylix"
"targets"
"swaylock"
"useWallpaper"
];
sinceRelease = 2605;
to = [
"stylix"
"targets"
"swaylock"
"image"
"enable"
];
})
];
}
32 changes: 22 additions & 10 deletions modules/wayfire/hm.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
{
mkTarget,
config,
lib,
pkgs,
...
}:
mkTarget {
options.useWallpaper = config.lib.stylix.mkEnableWallpaper "wayfire" true;
imports = [
(lib.mkRenamedOptionModuleWith {
from = [
"stylix"
"targets"
"wayfire"
"useWallpaper"
];
sinceRelease = 2605;
to = [
"stylix"
"targets"
"wayfire"
"image"
"enable"
];
})
];

config = [
(
Expand All @@ -17,11 +33,7 @@ mkTarget {
}
)
(
{
cfg,
image,
imageScalingMode,
}:
{ image, imageScalingMode }:
let
wayfireBackground = pkgs.runCommand "wayfire-background.png" { } ''
${lib.getExe' pkgs.imagemagick "convert"} ${image} $out
Expand All @@ -30,13 +42,13 @@ mkTarget {
{
wayland.windowManager.wayfire.settings = {
cube = {
cubemap_image = lib.mkIf cfg.useWallpaper wayfireBackground;
skydome_texture = lib.mkIf cfg.useWallpaper wayfireBackground;
cubemap_image = wayfireBackground;
skydome_texture = wayfireBackground;
};
};

wayland.windowManager.wayfire.wf-shell.settings = {
background.image = lib.mkIf cfg.useWallpaper wayfireBackground;
background.image = wayfireBackground;
background.fill_mode =
if imageScalingMode == "stretch" then
"stretch"
Expand Down