How do I add a ruby gem to the configuration file?
I have an old project where I use the ‘fugit’ gem, and I would like to
install it via my configuration.nix file.
I have made a gemset.nix for fugit, but how do I include it in configuration.nix, so it is working?
In NixOS, there’s a mostly strict separation between applications and libraries. You wouldn’t have a library listed in configuration.nix, because having a library in the store does nothing to ensure that any programs can find it.
So, since fugit is a library, we want to add this to a nix file for your project. You might want to try doing it with bundix. It’s a tool for working with bundlerEnv
.
I used gem to install it again, local in my user directory, since the ruby version had changes.
But this is probably not optimal since it will stop working when the Ruby version change.
Now the app I needed to work, I had already published on GitHub, so we should be able to make a NixOS packed for it. You find it here: Gochains app
1 Like