Use/Install rootless containerd with nerdctl

Preface: Im new to nixos. Im using nixos 23.05.
There is a nix package for nerdctl, but I cant find a way to “enable” rootless in it.
The package itself doesn’t come with the “containerd-rootless-setuptools.sh” script (looked for it with find /. | grep “containerd-rootless-setuptools”), and downloading the release directly from github and executing the script results in an error (cant find /bin/echo). Is there some option I can enable in the config or settings of the containerd package?

I just found out about nerdctl and immediately tried it, running into the same issue.
A shell script like containerd-rootless-setuptools.sh wouldn’t work in the world of NixOS any way.

Did either of you ever find a solution to this? I’ve installed nerdctl, containerd, and a number of supporting packages, but haven’t found the “containerd-rootless-setuptools” script anywhere. Going to pull the sources and take a look now…

From what I can tell, the containerd-rootless-setuptool.sh and container-rootless.sh scripts, which do necessary configuration to create a rootless environment for your non-root user account, these scripts do not get installed as part of the derivation and only exist in the source tree. You could copy the source tree locally and run these scripts (with some modifications) in your home directory, but it feels like the wrong approach. Rootless configurations for tools like this one aren’t meant to be shared system-wide, so probably the best target for a package like this one would be something like home manager. Even still, these scripts probably need adapted to work with home manager. As far as I can tell, most of the features of nerdctl assume you’ll want to use it rootless, so this package is really just broken/incomplete without setup for a one-off, unprivileged user. I might be willing to try my hand at it, but I’m not really sure how to go about that, with respect to modifying someone else’s package and submitting fixes for it.