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.
This commit is contained in:
Thiago Kenji Okada 2022-11-18 15:59:30 +00:00 committed by GitHub
parent fe85cc4c37
commit c94c9c342f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 5 deletions

View file

@ -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;
};

View file

@ -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

View file

@ -19,7 +19,7 @@
"unredir-if-possible" = true;
"dbe" = true;
};
experimentalBackends = true;
extraArgs = [ "--legacy-backends" ];
};
test.stubs.picom = { };