Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Set up and use a network of local development VMs
-------------------------------------------------
... using `Vagrant <https://www.vagrantup.com/>`_ to manage VirtualBox VMs [#]_.
To get started, first install Vagrant and make sure it works.
One possible way to do it in NixOS:
1. Install Vagrant, by adding the packages:
- ``vagrant`` (orchestrating virtual machines on the command line)
- Only use when version >= 2.2.16 has become available. Else see below.
- Optional: ``packer`` (for creating your own VM images)
2. Add configuration to install and enable VirtualBox:
- ``virtualisation.virtualbox.host.enable = true;``
3. Add your user to the ``vboxusers`` group, for example:
- ``users.extraGroups.vboxusers.members = [ "flo" "jp" ];``
.. [#] The author of this documentation wasted a lot of time trying to get Vagrant to work with KVM/libvirt. Issues with networking that looked like guest misconfigurations vanished after changing to the better-tested combination of Vagrant and VirtualBox.
Pre-Vagrant 2.2.16: Get Vagrant with the required fixes for NixOS guests
````````````````````````````````````````````````````````````````````````
The Vagrant nixos-guest template `received a critical update on 2021-03-08 <https://github.com/hashicorp/vagrant/commit/990d94ed9d0b3092e855bc1bb9deeeb7aa7792cf>`_ which is going to be in version 2.2.16 once it's out.
Retrieve and use the latest Vagrant development version locally::
git clone ssh://git@github.com/hashicorp/vagrant.git
cd vagrant/
nix-shell -p gcc gnumake git gnutar curl ruby
bundle install
bundle --binstubs exec
cd exec/
export PATH=`pwd`:$PATH
Use the local development environment
`````````````````````````````````````
Build and start the VMs::
vagrant up
Then::
morph build grid.nix
morph push grid.nix
morph deploy grid.nix switch