Install pnpm as standalone

By searching pnpm on search.nixos.org . It seems only option to install pnpm is to use nodePackages.pnpm. But I want to install pnpm as standalone (It installs pnpm even before installing node).

By this I can use pnpm as node version manager too.

Documentation to install pnpm as standalone can be found here Installation | pnpm

Basically we have to run curl -fsSL https://get.pnpm.io/install.sh | sh - .

I am wondering how to install this declaratively in my nixos (it uses flakes)

pnpm is JavaScript, so surely that curl is installing a bundled nodejs and pnpm. That’s exactly what you’ll get with the nix package but it’ll be sure to work wirh nixos.

Have you tried managing extra versions of nodejs with the pnpm from nixpkgs?