1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 11:36:05 +01:00

picom: add extraConfig to options

The picom module's `services.picom.settings` converts Nix expressions
to the libconfig format. However, that option currently does not have
a way to specify libconfig lists (enclosed in parentheses `()`), and
can only specify arrays (enclosed in square brackets `[]`). This makes
it impossible to specify certain picom configuration options, such as
animations (which are specified using lists).

This commit adds an `extraConfig` option to the picom module as an
escape hatch so that users can still specify picom options that are not
currently representable through `services.picom.settings`.
This commit is contained in:
Dixon Sean Low Yan Feng 2025-10-25 10:14:02 +08:00 committed by Austin Horstman
parent 7296022150
commit 0bc5f414f8

View file

@ -77,9 +77,12 @@ let
${v}
'';
toConf = attrs: concatStringsSep "\n" (mkAttrsString true cfg.settings);
toConf = attrs: concatStringsSep "\n" (mkAttrsString true attrs);
configFile = toConf cfg.settings;
configFile = concatStringsSep "\n" [
(toConf cfg.settings)
cfg.extraConfig
];
in
{
@ -347,6 +350,24 @@ in
CONFIGURATION FILES section at `picom(1)`.
'';
};
extraConfig = mkOption {
type = types.lines;
default = "";
example = ''
animations = (
{
triggers = [ "open", "show" ];
preset = "slide-in";
direction = "up";
duration = 0.2;
}
)
'';
description = ''
Extra configuration lines to append to the picom configuration file.
'';
};
};
config = mkIf cfg.enable {