Newer version of bundler in bundlerEnv

I have a project that requires bundler 2.0.1, the one installed form nix is 1.17.2.

The problem is that, I can’t run bundix because it uses bundler if I have newer version in the Gemfile.lock bundler fails and tells to first install newer version of bundler via gem install

Is there a way of installing new version of bundler?

If you can build your own derivation for bundler 2.0.1 then you can set it up as a custom overlay that overrides the bundler package. I imagine there’s some nix-shell --arg invocation for passing that overlay, something like nix-shell --arg config '{ overlays = [ (import ./bundler-2.0.1.nix) ]; }' -i bash -p bash bundix bundler