I wonder why Nixos doesn’t handle Vagrant correctly ?
The vagrant package launch a build that doesn’t go well on my machine as Vagrant is not usable at the end. Hence, what is wrong ? Is there a technical issue or is it just that this is not considered important ?
Btw even the wiki page about Vagrant is quite unclear about this.
Here is the error I get after entering nix-shell -p vagrant and invoking vagrant.
There seems to be a problem with the ruby version but I do not know a lot about build and dependencies (particularly in NixOS).
First of all, I don’t even understand why vagrant is built, this is the first time that I encounter a build when using nix-shell -p. I was expecting to see nix download a binary.
<internal:/nix/store/vm2yjlip09dylmrr9rpjqfgz2gi1kky8-ruby-3.1.6/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require': incompatible library version - /home/allan/.local/share/gem/ruby/3.1.0/gems/strscan-3.1.0/lib/strscan.so (LoadError)
from <internal:/nix/store/vm2yjlip09dylmrr9rpjqfgz2gi1kky8-ruby-3.1.6/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from /nix/store/aamrlb03qjx8xwv3nwbsc32xv62g7fwz-vagrant-2.4.1/lib/ruby/gems/3.1.0/gems/net-ssh-7.2.1/lib/net/ssh/known_hosts.rb:1:in `<top (required)>'
from <internal:/nix/store/vm2yjlip09dylmrr9rpjqfgz2gi1kky8-ruby-3.1.6/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from <internal:/nix/store/vm2yjlip09dylmrr9rpjqfgz2gi1kky8-ruby-3.1.6/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from /nix/store/aamrlb03qjx8xwv3nwbsc32xv62g7fwz-vagrant-2.4.1/lib/ruby/gems/3.1.0/gems/net-ssh-7.2.1/lib/net/ssh/transport/algorithms.rb:2:in `<top (required)>'
from <internal:/nix/store/vm2yjlip09dylmrr9rpjqfgz2gi1kky8-ruby-3.1.6/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from <internal:/nix/store/vm2yjlip09dylmrr9rpjqfgz2gi1kky8-ruby-3.1.6/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from /nix/store/aamrlb03qjx8xwv3nwbsc32xv62g7fwz-vagrant-2.4.1/lib/ruby/gems/3.1.0/gems/net-ssh-7.2.1/lib/net/ssh/transport/session.rb:6:in `<top (required)>'
from <internal:/nix/store/vm2yjlip09dylmrr9rpjqfgz2gi1kky8-ruby-3.1.6/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from <internal:/nix/store/vm2yjlip09dylmrr9rpjqfgz2gi1kky8-ruby-3.1.6/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from /nix/store/aamrlb03qjx8xwv3nwbsc32xv62g7fwz-vagrant-2.4.1/lib/ruby/gems/3.1.0/gems/net-ssh-7.2.1/lib/net/ssh.rb:12:in `<top (required)>'
from <internal:/nix/store/vm2yjlip09dylmrr9rpjqfgz2gi1kky8-ruby-3.1.6/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from <internal:/nix/store/vm2yjlip09dylmrr9rpjqfgz2gi1kky8-ruby-3.1.6/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from /nix/store/lqa1z4afxn7d2d0ls66im6l437dnpsqf-vagrant-2.4.1/lib/ruby/gems/3.1.0/gems/vagrant-2.4.1/lib/vagrant/patches/net-ssh.rb:4:in `<top (required)>'
from <internal:/nix/store/vm2yjlip09dylmrr9rpjqfgz2gi1kky8-ruby-3.1.6/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from <internal:/nix/store/vm2yjlip09dylmrr9rpjqfgz2gi1kky8-ruby-3.1.6/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from /nix/store/lqa1z4afxn7d2d0ls66im6l437dnpsqf-vagrant-2.4.1/lib/ruby/gems/3.1.0/gems/vagrant-2.4.1/lib/vagrant.rb:7:in `<top (required)>'
from <internal:/nix/store/vm2yjlip09dylmrr9rpjqfgz2gi1kky8-ruby-3.1.6/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from <internal:/nix/store/vm2yjlip09dylmrr9rpjqfgz2gi1kky8-ruby-3.1.6/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:136:in `require'
from /nix/store/lqa1z4afxn7d2d0ls66im6l437dnpsqf-vagrant-2.4.1/lib/ruby/gems/3.1.0/gems/vagrant-2.4.1/bin/vagrant:88:in `<top (required)>'
from /nix/store/lqa1z4afxn7d2d0ls66im6l437dnpsqf-vagrant-2.4.1/bin/.vagrant-wrapped:18:in `load'
from /nix/store/lqa1z4afxn7d2d0ls66im6l437dnpsqf-vagrant-2.4.1/bin/.vagrant-wrapped:18:in `<main>'
There is also a lot of error during the build.
But the output is really long, I can still paste the relevant parts, if necessary.
What channel are you on? (Not sure this question is relevant anymore though; stopped checking progress on channels / flakes / etc. a while back.)
Before getting your hopes up, please know that I may be the least qualified here to try to figure this one out, but answering those questions will help others get to conclusions and thus help them to give you some tips.
With that said, it looks to me that nix-shell -p vagrant is trying to build the package locally. Although not sure why it would be failing even then…
how did you install vagrant, and was there a local build for you too ?
I did everything the way it’s documented in my post with nix-shell -p vagrant on a newly installed NixOS, so the config wasn’t pretty vanilla too (aside from the changes mentioned in the post).
Speaking of which, do you have your configuration.nix posted somewhere? It may give some clues to folks.
On the other hand:
What if you tried a different channel, such as 23.11?
If you mean that if it was built from source too when I did, then the answer is no; it simply fetched the binary and its dependencies. (I just gave nix-shell -p vagrant a try on a Mac M1 on channel 23.11 and it worked too.)