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,
|
mkTarget,
|
||||||
pkgs,
|
pkgs,
|
||||||
config,
|
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
mkTarget {
|
mkTarget {
|
||||||
|
imports = [
|
||||||
|
(lib.mkRenamedOptionModuleWith {
|
||||||
|
from = [
|
||||||
|
"stylix"
|
||||||
|
"targets"
|
||||||
|
"gnome"
|
||||||
|
"useWallpaper"
|
||||||
|
];
|
||||||
|
sinceRelease = 2605;
|
||||||
|
to = [
|
||||||
|
"stylix"
|
||||||
|
"targets"
|
||||||
|
"gnome"
|
||||||
|
"image"
|
||||||
|
"enable"
|
||||||
|
];
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
autoEnable = pkgs.stdenv.hostPlatform.isLinux;
|
autoEnable = pkgs.stdenv.hostPlatform.isLinux;
|
||||||
autoEnableExpr = "pkgs.stdenv.hostPlatform.isLinux";
|
autoEnableExpr = "pkgs.stdenv.hostPlatform.isLinux";
|
||||||
|
|
||||||
options.useWallpaper = config.lib.stylix.mkEnableWallpaper "GNOME" true;
|
|
||||||
|
|
||||||
config = [
|
config = [
|
||||||
(
|
(
|
||||||
{ cfg, image }:
|
{ image }:
|
||||||
{
|
{
|
||||||
dconf.settings."org/gnome/desktop/background" = {
|
dconf.settings."org/gnome/desktop/background" = {
|
||||||
picture-uri = lib.mkIf cfg.useWallpaper "file://${image}";
|
picture-uri = "file://${image}";
|
||||||
picture-uri-dark = lib.mkIf cfg.useWallpaper "file://${image}";
|
picture-uri-dark = "file://${image}";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,29 @@
|
||||||
{
|
{ mkTarget, lib, ... }:
|
||||||
mkTarget,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
mkTarget {
|
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 = [
|
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, lib, ... }:
|
||||||
mkTarget,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
mkTarget {
|
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 =
|
config =
|
||||||
{ cfg, image }:
|
{ image }:
|
||||||
{
|
{
|
||||||
services.xserver.displayManager.lightdm.background =
|
services.xserver.displayManager.lightdm.background = image;
|
||||||
lib.mkIf cfg.useWallpaper image;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,23 @@
|
||||||
{
|
{ mkTarget, lib, ... }:
|
||||||
mkTarget,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
mkTarget {
|
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 = [
|
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,19 +6,35 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
mkTarget {
|
mkTarget {
|
||||||
|
imports = [
|
||||||
|
(lib.mkRenamedOptionModuleWith {
|
||||||
|
from = [
|
||||||
|
"stylix"
|
||||||
|
"targets"
|
||||||
|
"regreet"
|
||||||
|
"useWallpaper"
|
||||||
|
];
|
||||||
|
sinceRelease = 2605;
|
||||||
|
to = [
|
||||||
|
"stylix"
|
||||||
|
"targets"
|
||||||
|
"regreet"
|
||||||
|
"image"
|
||||||
|
"enable"
|
||||||
|
];
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
autoEnable = pkgs.stdenv.hostPlatform.isLinux;
|
autoEnable = pkgs.stdenv.hostPlatform.isLinux;
|
||||||
autoEnableExpr = "pkgs.stdenv.hostPlatform.isLinux";
|
autoEnableExpr = "pkgs.stdenv.hostPlatform.isLinux";
|
||||||
|
|
||||||
options = {
|
options.extraCss = lib.mkOption {
|
||||||
useWallpaper = config.lib.stylix.mkEnableWallpaper "ReGreet" true;
|
description = ''
|
||||||
extraCss = lib.mkOption {
|
Extra code added to `programs.regreet.extraCss` option.
|
||||||
description = ''
|
'';
|
||||||
Extra code added to `programs.regreet.extraCss` option.
|
type = lib.types.lines;
|
||||||
'';
|
default = "";
|
||||||
type = lib.types.lines;
|
example = "window.background { border-radius: 0; }";
|
||||||
default = "";
|
|
||||||
example = "window.background { border-radius: 0; }";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = [
|
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
|
if imageScalingMode == "fill" then
|
||||||
"Cover"
|
"Cover"
|
||||||
else if imageScalingMode == "fit" then
|
else if imageScalingMode == "fit" then
|
||||||
|
|
@ -84,8 +100,7 @@ mkTarget {
|
||||||
"Fill"
|
"Fill"
|
||||||
# No other available options
|
# No other available options
|
||||||
else
|
else
|
||||||
null
|
null;
|
||||||
);
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
(
|
(
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,6 @@ mkTarget {
|
||||||
lib.versionAtLeast config.home.stateVersion "23.05" && pkgs.stdenv.hostPlatform.isLinux
|
lib.versionAtLeast config.home.stateVersion "23.05" && pkgs.stdenv.hostPlatform.isLinux
|
||||||
'';
|
'';
|
||||||
|
|
||||||
options.useWallpaper = config.lib.stylix.mkEnableWallpaper "Swaylock" true;
|
|
||||||
|
|
||||||
config = [
|
config = [
|
||||||
(
|
(
|
||||||
{ colors }:
|
{ 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"
|
"useWallpaper"
|
||||||
];
|
];
|
||||||
})
|
})
|
||||||
|
(lib.mkRenamedOptionModuleWith {
|
||||||
|
from = [
|
||||||
|
"stylix"
|
||||||
|
"targets"
|
||||||
|
"swaylock"
|
||||||
|
"useWallpaper"
|
||||||
|
];
|
||||||
|
sinceRelease = 2605;
|
||||||
|
to = [
|
||||||
|
"stylix"
|
||||||
|
"targets"
|
||||||
|
"swaylock"
|
||||||
|
"image"
|
||||||
|
"enable"
|
||||||
|
];
|
||||||
|
})
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,28 @@
|
||||||
{
|
{
|
||||||
mkTarget,
|
mkTarget,
|
||||||
config,
|
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
mkTarget {
|
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 = [
|
config = [
|
||||||
(
|
(
|
||||||
|
|
@ -17,11 +33,7 @@ mkTarget {
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
(
|
(
|
||||||
{
|
{ image, imageScalingMode }:
|
||||||
cfg,
|
|
||||||
image,
|
|
||||||
imageScalingMode,
|
|
||||||
}:
|
|
||||||
let
|
let
|
||||||
wayfireBackground = pkgs.runCommand "wayfire-background.png" { } ''
|
wayfireBackground = pkgs.runCommand "wayfire-background.png" { } ''
|
||||||
${lib.getExe' pkgs.imagemagick "convert"} ${image} $out
|
${lib.getExe' pkgs.imagemagick "convert"} ${image} $out
|
||||||
|
|
@ -30,13 +42,13 @@ mkTarget {
|
||||||
{
|
{
|
||||||
wayland.windowManager.wayfire.settings = {
|
wayland.windowManager.wayfire.settings = {
|
||||||
cube = {
|
cube = {
|
||||||
cubemap_image = lib.mkIf cfg.useWallpaper wayfireBackground;
|
cubemap_image = wayfireBackground;
|
||||||
skydome_texture = lib.mkIf cfg.useWallpaper wayfireBackground;
|
skydome_texture = wayfireBackground;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
wayland.windowManager.wayfire.wf-shell.settings = {
|
wayland.windowManager.wayfire.wf-shell.settings = {
|
||||||
background.image = lib.mkIf cfg.useWallpaper wayfireBackground;
|
background.image = wayfireBackground;
|
||||||
background.fill_mode =
|
background.fill_mode =
|
||||||
if imageScalingMode == "stretch" then
|
if imageScalingMode == "stretch" then
|
||||||
"stretch"
|
"stretch"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue