diff --git a/modules/gnome/hm.nix b/modules/gnome/hm.nix index 0e43b209..8a0fdecc 100644 --- a/modules/gnome/hm.nix +++ b/modules/gnome/hm.nix @@ -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}"; }; } ) diff --git a/modules/hyprlock/hm.nix b/modules/hyprlock/hm.nix index 8c59fa38..705ebfd0 100644 --- a/modules/hyprlock/hm.nix +++ b/modules/hyprlock/hm.nix @@ -1,17 +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; } ) ( diff --git a/modules/lightdm/nixos.nix b/modules/lightdm/nixos.nix index fe512f0f..eda8bb89 100644 --- a/modules/lightdm/nixos.nix +++ b/modules/lightdm/nixos.nix @@ -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; }; } diff --git a/modules/limine/nixos.nix b/modules/limine/nixos.nix index 0283c07a..da7bbf32 100644 --- a/modules/limine/nixos.nix +++ b/modules/limine/nixos.nix @@ -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 = [ ( @@ -25,9 +37,9 @@ mkTarget { } ) ( - { cfg, image }: + { image }: { - boot.loader.limine.style.wallpapers = lib.mkIf cfg.useWallpaper [ image ]; + boot.loader.limine.style.wallpapers = [ image ]; } ) ( diff --git a/modules/regreet/nixos.nix b/modules/regreet/nixos.nix index 234294b4..a2ab94f0 100644 --- a/modules/regreet/nixos.nix +++ b/modules/regreet/nixos.nix @@ -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 = [ @@ -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 = if imageScalingMode == "fill" then "Cover" else if imageScalingMode == "fit" then @@ -84,8 +100,7 @@ mkTarget { "Fill" # No other available options else - null - ); + null; } ) ( diff --git a/modules/swaylock/hm.nix b/modules/swaylock/hm.nix index ee0e3570..5a73f9d6 100644 --- a/modules/swaylock/hm.nix +++ b/modules/swaylock/hm.nix @@ -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 }: @@ -66,9 +64,9 @@ mkTarget { } ) ( - { cfg, image }: + { image }: { - programs.swaylock.settings.image = lib.mkIf cfg.useWallpaper image; + programs.swaylock.settings.image = image; } ) ( @@ -94,5 +92,21 @@ mkTarget { "useWallpaper" ]; }) + (lib.mkRenamedOptionModuleWith { + from = [ + "stylix" + "targets" + "swaylock" + "useWallpaper" + ]; + sinceRelease = 2605; + to = [ + "stylix" + "targets" + "swaylock" + "image" + "enable" + ]; + }) ]; } diff --git a/modules/wayfire/hm.nix b/modules/wayfire/hm.nix index d090e89d..14b16e8a 100644 --- a/modules/wayfire/hm.nix +++ b/modules/wayfire/hm.nix @@ -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 = [ ( @@ -17,11 +33,7 @@ mkTarget { } ) ( - { - cfg, - image, - imageScalingMode, - }: + { image, imageScalingMode }: let wayfireBackground = pkgs.runCommand "wayfire-background.png" { } '' ${lib.getExe' pkgs.imagemagick "convert"} ${image} $out @@ -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"