Picom

From NixOS Wiki

picom is a standalone compositor for Xorg, suitable for use with window managers that do not provide compositing. picom is a fork of compton, which is a fork of xcompmgr-dana, which in turn is a fork of xcompmgr.

Installation

Put the following line into your system or home-manager config to install picom and enable it's service:

services.picom.enable = true;

If you just want to install picom without automatically running it every time your system boots, use this instead:

packages.picom.enable = true;

Installing a custom fork

Picom is known for having multiple forks, each having their own features such as animations, better performance or fixes that the most popular forks don't implement. Usually these forks are not available in nixpkgs. But with the following code you can compile and build custom versions from any source. Nurl can be used to generate fetch calls.

environment.systemPackages = with pkgs; [
  (picom.overrideAttrs (oldAttrs: rec {
    src = fetchFromGitHub {
      owner = "pijulius";
      repo = "picom";
      rev = "da21aa8ef70f9796bc8609fb495c3a1e02df93f9";
      hash = "sha256-rxGWAot+6FnXKjNZkMl1uHHHEMVSxm36G3VoV1vSXLA=";
    };
  }))
];

Troubleshooting

Issues with Nvidia proprietary drivers

See Nvidia#Fix_app_flickering_with_Picom