Code change:
<del> { mkDerivation , lib , fetchFromGitHub , qtbase , cmake , qttools , qtsvg , nix-update-script , fetchpatch , kguiaddons }: mkDerivation rec { pname = "flameshot"; version = "12.1.0"; src = fetchFromGitHub { owner = "flameshot-org"; repo = "flameshot"; rev = "v${version}"; sha256 = "sha256-omyMN8d+g1uYsEw41KmpJCwOmVWLokEfbW19vIvG79w="; }; patches = [ # https://github.com/flameshot-org/flameshot/pull/3166 (fetchpatch { name = "10-fix-wayland.patch"; url = "https://github.com/flameshot-org/flameshot/commit/5fea9144501f7024344d6f29c480b000b2dcd5a6.patch"; sha256 = "sha256-SnjVbFMDKD070vR4vGYrwLw6scZAFaQA4b+MbI+0W9E="; }) ]; passthru = { updateScript = nix-update-script { }; }; cmakeFlags = [ (lib.cmakeBool "USE_WAYLAND_CLIPBOARD" true) ]; nativeBuildInputs = [ cmake qttools qtsvg ]; buildInputs = [ qtbase kguiaddons ]; meta = with lib; { description = "Powerful yet simple to use screenshot software"; homepage = "https://github.com/flameshot-org/flameshot"; mainProgram = "flameshot"; maintainers = with maintainers; [ scode oxalica ]; license = licenses.gpl3Plus; platforms = platforms.linux ++ platforms.darwin; }; } </del>

Related discussion:
text: flameshot has two backends, one that works in KDE, and one that works in wlroots-based compositors, but the flag USEWAYLANDGRIM must be set in order to enable it. Steps to reproduce the behavior: to use flameshot in wlroots-based compositor like sway It works [nix-shell:~]$ env XDGCURRENTDESKTOP=sway XDGSESSIONDESKTOP=sway QTQPAPLATFORM=wayland flameshot gui flameshot: error: Unable to capture screen flameshot: error: Unable to capture screen Wayland does not support QWindow::requestActivate() flameshot: info: Screenshot aborted. Add any other context about the problem here. Please run and paste the result. Add a :+1: [reaction] to [issues you find important]. [reaction]: [issues you find important]:
The flag upstream:
It turns out that this flag is not yet available in a release. To use it, I created the following package override: and now flameshot works! For home-manager I also the following:
Not sure I'd call this a bug if there's no release with this code, though it seems like it will be some time before the next release:
I can confirm that the overlay above works for me. There's a small caveat: should be available in the PATH, otherwise the setup will be a little more janky.
Whether or not there's a release, it's still a bug. There were more attempts to fix this 2-3 years back, but as you can read in that linked issue, the authors are currently not working on updates. Since there's no official release, it might not make sense to issue an interim package update, but as long as I have my working flameshot, I'm happy. I just wanted to share this with others who run into the same problem
I hadn't noticed that... I've just updated buildInputs (to add grim) and removed grim from my default home-manager environment... I think that should take care of it, but I'll test to be sure.
After using for awhile, I can confirm. You need to add grim into your environment in order for this to work consistently.
I can't seem to get that to work on GNOME see
Yes, grim is for wlroots-based compositors, not mutter.
Unrelated to this issue then?