I have successfully reached my goal. I am effectively using zram in dom0 and in templates.
While hoping @marmarek will consider to include SwapOnZRAM by default in the next releases of Qubes based on >= fedora-33, so far I’d be happy to find a solution for annoyance caused by using zram.
Namely, whenever I start any VM, its virtual block device zram0 is also populated to device widget.
For various reasons ranging from cosmetics to security I’d like to hide zram device to be populated/shown in the device widget.
For example, even gnome-disk-utility devs recognzed this and hid zram from the interface since January 9 2021, > versions 3.38.2 and up
Is there a way to achieve this, zram not to be shown in the device widget interface?
What is maybe important is that dom0’s zram isn’t listed in device widget and I can’t remember if I did it somehow, but after researching bash history, couldn’t find any trace of such an action done by me…
Bump in case someone with an idea/solution missed it. Something related to mounting with nodev? How to do that for zram devices in templates and other qubes?
A udev(7) rule in your AppVM('s template) that matches zram devices, sets ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}="1", and is in a file ordered before 99-qubes-block.rules should work.