This is not the nix way…
Perhaps replacing “install the programs you need” with “make the programs available” would better describe your interpretation of ‘the nix way’. – But to me e.g. nix shell nixpkgs#ruby (or an expression like pkgs.mkShell { packages = [ pkgs.ruby ] }) can both be reasonably understood to satisfy “install the packages you need”.
Perhaps you’d quibble with the phrasing, sure, but my point is “how do I do X in Nix” is as approachable as on any other Linux: get the packages you need, try using them, & fix any problems that come up.
If you’ve already got a strong idea in mind as to how the problem should be solved, good, try that.
… If I do that It would be better to switch to other distro. …
I’d encourage a more shallow and iterative relationship with Nix.
It’s better to use Nix for 95% of stuff, than for 0%. If you can’t figure out how to do something in the most elegant, idiomatic way… you can always have another go at it later once you’re more familiar with Nix.
Relatedly, I found this pretty interesting:
… I already wrote shell.nix that install ruby and bundler but I cant figure out how to install some gems
Also not sure how to manage the versions of those gems …
If you want help with more specific problems you’re facing, I’d encourage you to share what you’ve tried and what’s not working. Perhaps as a short, self-contained example of what it is you can’t get working.