From c94c9c342f16914565b1abf413b09fbbb05fa4b8 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Fri, 18 Nov 2022 15:59:30 +0000 Subject: [PATCH] picom: remove experimentalBackends, add extraArgs (#3423) `--experimental-backends` flag was removed in the recent released picom v10. Using it now will result in the program exiting. v10 also introduces its counter-part, `--legacy-backends`. However this will be removed soon. Instead of adding this as an separate option, add `extraArgs` option so for those that they want they can pass it manuall. It is also more future proof. --- modules/services/picom.nix | 15 ++++++++++++--- .../picom-basic-configuration-expected.service | 2 +- .../services/picom/picom-basic-configuration.nix | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/modules/services/picom.nix b/modules/services/picom.nix index 75ed6a72a..f3c47a6c5 100644 --- a/modules/services/picom.nix +++ b/modules/services/picom.nix @@ -54,6 +54,8 @@ in { imports = [ (mkRemovedOptionModule [ "services" "picom" "refreshRate" ] "The option `refresh-rate` has been deprecated by upstream.") + (mkRemovedOptionModule [ "services" "picom" "experimentalBackends" ] + "The option `--experimental-backends` has been removed by upstream.") (mkRemovedOptionModule [ "services" "picom" "extraOptions" ] "This option has been replaced by `services.picom.settings`.") (mkRenamedOptionModule [ "services" "picom" "opacityRule" ] [ @@ -66,8 +68,6 @@ in { options.services.picom = { enable = mkEnableOption "Picom X11 compositor"; - experimentalBackends = mkEnableOption "the new experimental backends"; - fade = mkOption { type = types.bool; default = false; @@ -213,6 +213,15 @@ in { ''; }; + extraArgs = mkOption { + type = with types; listOf str; + default = [ ]; + example = literalExpression ''[ "--legacy-backends" ]''; + description = '' + Extra arguments to be passed to the picom executable. + ''; + }; + package = mkOption { type = types.package; default = pkgs.picom; @@ -306,7 +315,7 @@ in { ExecStart = concatStringsSep " " ([ "${cfg.package}/bin/picom" "--config ${config.xdg.configFile."picom/picom.conf".source}" - ] ++ optional cfg.experimentalBackends "--experimental-backends"); + ] ++ cfg.extraArgs); Restart = "always"; RestartSec = 3; }; diff --git a/tests/modules/services/picom/picom-basic-configuration-expected.service b/tests/modules/services/picom/picom-basic-configuration-expected.service index 62620502c..6aeef2249 100644 --- a/tests/modules/services/picom/picom-basic-configuration-expected.service +++ b/tests/modules/services/picom/picom-basic-configuration-expected.service @@ -2,7 +2,7 @@ WantedBy=graphical-session.target [Service] -ExecStart=@picom@/bin/picom --config /nix/store/00000000000000000000000000000000-hm_picompicom.conf --experimental-backends +ExecStart=@picom@/bin/picom --config /nix/store/00000000000000000000000000000000-hm_picompicom.conf --legacy-backends Restart=always RestartSec=3 diff --git a/tests/modules/services/picom/picom-basic-configuration.nix b/tests/modules/services/picom/picom-basic-configuration.nix index 67848f52f..1c2689799 100644 --- a/tests/modules/services/picom/picom-basic-configuration.nix +++ b/tests/modules/services/picom/picom-basic-configuration.nix @@ -19,7 +19,7 @@ "unredir-if-possible" = true; "dbe" = true; }; - experimentalBackends = true; + extraArgs = [ "--legacy-backends" ]; }; test.stubs.picom = { };