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>
This commit is contained in:
parent
ae5c0239ae
commit
ce22070ec5
7 changed files with 156 additions and 64 deletions
|
|
@ -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}";
|
||||
};
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
)
|
||||
(
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 ];
|
||||
}
|
||||
)
|
||||
(
|
||||
|
|
|
|||
|
|
@ -6,12 +6,29 @@
|
|||
...
|
||||
}:
|
||||
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 {
|
||||
options.extraCss = lib.mkOption {
|
||||
description = ''
|
||||
Extra code added to `programs.regreet.extraCss` option.
|
||||
'';
|
||||
|
|
@ -19,7 +36,6 @@ mkTarget {
|
|||
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;
|
||||
}
|
||||
)
|
||||
(
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
];
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue