From fa126dbedee8de3e2ffa39dcefd3ce612a543f0c Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Wed, 19 Jul 2023 10:38:14 +0200 Subject: [PATCH] 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. --- .../services/x11/desktop-managers/default.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/nixos/modules/services/x11/desktop-managers/default.nix b/nixos/modules/services/x11/desktop-managers/default.nix index 7ff8cabe244a..0d94ce74a856 100644 --- a/nixos/modules/services/x11/desktop-managers/default.nix +++ b/nixos/modules/services/x11/desktop-managers/default.nix @@ -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.