There are some things I couldn't figure out to use with Nix so I'm leaving the imperative way of these things.
Flatpak is required.
Installing flatpak:
services.flatpak.enable = true;Add the Flathub repository:
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepoInstall flameshot:
flatpak install flathub org.flameshot.Flameshotflatpak permission-set screenshot screenshot org.flameshot.Flameshot yes
flatpak run --command=flameshot org.flameshot.Flameshot gui