services.xserver.desktopManager: Allow to disable wallpaper

The wallpaper setting command is not used by many people as the
`.background-image` convention is new and people have other mechanisms
in place.

I am not interested in this feature and I'm worried by the closure size
of `feh`, which is 400Mb due to `imlib2Full`.

The wallpaper are enabled by default.
This commit is contained in:
Jules Aguillon
2023-07-19 10:38:14 +02:00
parent 8e47088096
commit fa126dbede
@@ -13,7 +13,7 @@ let
# If desktop manager `d' isn't capable of setting a background and
# the xserver is enabled, `feh' or `xsetroot' are used as a fallback.
needBGCond = d: !(d ? bgSupport && d.bgSupport) && xcfg.enable;
needBGCond = d: !(d ? bgSupport && d.bgSupport) && xcfg.enable && cfg.wallpaper.enable;
in
@@ -48,6 +48,16 @@ in
services.xserver.desktopManager = {
wallpaper = {
enable = mkOption {
type = types.bool;
default = true;
description = ''
The file {file}`~/.background-image` is used as a background image.
The `mode` option specifies the placement of this image onto your desktop.
To disable this, set this option to `false`.
'';
};
mode = mkOption {
type = types.enum [
"center"
@@ -59,9 +69,6 @@ in
default = "scale";
example = "fill";
description = ''
The file {file}`~/.background-image` is used as a background image.
This option specifies the placement of this image onto your desktop.
Possible values:
`center`: Center the image on the background. If it is too small, it will be surrounded by a black border.
`fill`: Like `scale`, but preserves aspect ratio by zooming the image until it fits. Either a horizontal or a vertical part of the image will be cut off.