Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vagrant virtualbox image #101120

Merged
merged 8 commits into from Oct 20, 2020
Merged

Conversation

joseph-long
Copy link
Contributor

@joseph-long joseph-long commented Oct 20, 2020

Motivation for this change

Make it possible for NixOS to build VirtualBox VM images compatible with Vagrant and vagrant-nixos-plugin.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@joseph-long joseph-long marked this pull request as ready for review October 20, 2020 06:58
@joseph-long
Copy link
Contributor Author

@zimbatm I think this does the trick.

Now, thinking ahead... would it be possible for the project CI/CD system to release these images to Vagrant Cloud with a new NixOS release?

@zimbatm
Copy link
Member

zimbatm commented Oct 20, 2020

Thanks for taking this to the finish line. I can see a few potential improvements but since this is working, let's get it merged first.

@garbas was talking of releasing cloud images automatically in his talk at NixCon and this could be part of it once the setup is in place.

@zimbatm zimbatm merged commit a2ee5cb into NixOS:master Oct 20, 2020
@zimbatm
Copy link
Member

zimbatm commented Oct 20, 2020

Another thing that could be done is to add the target format to the nixos-generators project. See nix-community/nixos-generators#50

zimbatm added a commit to zimbatm/nixos-generators that referenced this pull request Oct 20, 2020
This will ultimately replace the nix-community/nixbox project.

See nix-community/nixbox#38

Depends on NixOS/nixpkgs#101120
zimbatm added a commit to zimbatm/nixos-generators that referenced this pull request Oct 20, 2020
This will ultimately replace the nix-community/nixbox project.

See nix-community/nixbox#38

Depends on NixOS/nixpkgs#101120
@garbas
Copy link
Member

garbas commented Oct 20, 2020

@joseph-long 💯 to get it into the state where we can publish this on nixos.org

I'm collecting the ideas what needs to be done here: NixOS/nixos-homepage#447

If you have some time to push this forward I would really appreciate it.

@@ -8,6 +8,12 @@
./virtualbox-image.nix
];

virtualbox.vmHasAudio = false;
virtualbox.vmHasUSB = false;
sound.enable = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am trying to reuse my nixos configuration for the vagrant box. I had the error

error: The option `sound.enable' has conflicting definition values:
       - In `/nix/store/p53cz6rh27q40g9i0q98k3vfrz6lm12w-source/nixos/modules/virtualisation/vagrant-virtualbox-image.nix': false
       - In `/nix/store/p53cz6rh27q40g9i0q98k3vfrz6lm12w-source/nixos/modules/config/pulseaudio.nix': true
(use '--show-trace' to show detailed location information)

Is there any particular reason why we must disable audio, usb?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants