From 627a3932b9cfccd276e028c128f7fbbeef285804 Mon Sep 17 00:00:00 2001 From: Lin Xianyi Date: Mon, 11 Aug 2025 18:54:27 +0800 Subject: [PATCH] swww: add extraArgs for swww-daemon --- modules/services/swww.nix | 16 +++++++++++++++- .../swww/swww-graphical-session-target.nix | 5 +++++ .../swww/swww-graphical-session-target.service | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/modules/services/swww.nix b/modules/services/swww.nix index cb622498..422aa1eb 100644 --- a/modules/services/swww.nix +++ b/modules/services/swww.nix @@ -13,6 +13,20 @@ in options.services.swww = { enable = lib.mkEnableOption "swww, a Solution to your Wayland Wallpaper Woes"; package = lib.mkPackageOption pkgs "swww" { }; + extraArgs = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ ]; + example = [ + "--no-cache" + "--layer" + "bottom" + ]; + description = '' + Options given to swww-daemon when the service is run. + + See `swww-daemon --help` for more information. + ''; + }; }; config = lib.mkIf cfg.enable { @@ -35,7 +49,7 @@ in }; Service = { - ExecStart = "${lib.getExe' cfg.package "swww-daemon"}"; + ExecStart = "${lib.getExe' cfg.package "swww-daemon"} ${lib.escapeShellArgs cfg.extraArgs}"; Restart = "always"; RestartSec = 10; }; diff --git a/tests/modules/services/swww/swww-graphical-session-target.nix b/tests/modules/services/swww/swww-graphical-session-target.nix index c55b7153..c7bd2efa 100644 --- a/tests/modules/services/swww/swww-graphical-session-target.nix +++ b/tests/modules/services/swww/swww-graphical-session-target.nix @@ -3,6 +3,11 @@ services.swww = { enable = true; package = config.lib.test.mkStubPackage { outPath = "@swww@"; }; + extraArgs = [ + "--no-cache" + "--layer" + "bottom" + ]; }; nmt.script = '' diff --git a/tests/modules/services/swww/swww-graphical-session-target.service b/tests/modules/services/swww/swww-graphical-session-target.service index 4c219ff7..180ca621 100644 --- a/tests/modules/services/swww/swww-graphical-session-target.service +++ b/tests/modules/services/swww/swww-graphical-session-target.service @@ -2,7 +2,7 @@ WantedBy=graphical-session.target [Service] -ExecStart=@swww@/bin/swww-daemon +ExecStart=@swww@/bin/swww-daemon --no-cache --layer bottom Restart=always RestartSec=10