Resolve the following warnings:
- The option `programs.wpaperd.settings' defined in
`/nix/store/<HASH>-source/modules/wpaperd/hm.nix' has been renamed
to `services.wpaperd.settings'.
- The option `programs.vscode.extensions' defined in
`/nix/store/<HASH>-source/modules/vscode/hm.nix' has been renamed
to `programs.vscode.profiles.default.extensions'.
- The option `programs.vscode.userSettings' defined in
`/nix/store/<HASH>-source/modules/vscode/hm.nix' has been renamed
to `programs.vscode.profiles.default.userSettings'.
The VSCode theme is now only applied to the 'default' profile.
Closes: https://github.com/danth/stylix/issues/903
Link: https://github.com/danth/stylix/pull/905
Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
38 lines
994 B
Nix
38 lines
994 B
Nix
{ config, lib, ... }:
|
|
let
|
|
cfg = config.stylix.targets.wpaperd;
|
|
in
|
|
{
|
|
options.stylix.targets.wpaperd = {
|
|
enable = config.lib.stylix.mkEnableTarget "wpaperd" (
|
|
config.stylix.image != null
|
|
);
|
|
};
|
|
|
|
config = lib.mkIf (config.stylix.enable && cfg.enable) (
|
|
let
|
|
inherit (config.stylix) imageScalingMode;
|
|
|
|
# wpaperd doesn't have any mode close to the described behavior of center
|
|
modeMap = {
|
|
"stretch" = "stretch";
|
|
# wpaperd's center mode is closest to the described behavior of fill
|
|
"fill" = "center";
|
|
"fit" = "fit";
|
|
"tile" = "tile";
|
|
};
|
|
|
|
modeAttrs =
|
|
if builtins.hasAttr imageScalingMode modeMap then
|
|
{ mode = modeMap.${imageScalingMode}; }
|
|
else
|
|
lib.info "stylix: wpaperd: unsupported image scaling mode: ${imageScalingMode}"
|
|
{ };
|
|
in
|
|
{
|
|
services.wpaperd.settings.any = {
|
|
path = "${config.stylix.image}";
|
|
} // modeAttrs;
|
|
}
|
|
);
|
|
}
|