I want to install a package that’s distributed for Linux only as as snap. Is that possible?
I don’t know if it is possible but I’m interested in the answer as well.
We do not have snapd packaged so until someone does that, it is not possible to install the package. See also https://github.com/NixOS/nixpkgs/issues/30336.
Alternatively, you might try to reverse https://github.com/NixOS/nixpkgs/blob/dd65c8b2a7c936f2456c4d2c7a2dc6789bc3f177/pkgs/build-support/snap/make-snap.nix, i.e. try to mount the squashfs image manually.
Also have a look at Spotify packaging, it’s based on the snap because that’s the only Spotify version with a stable download link.