Skip to content
Snippets Groups Projects
Select Git revision
  • 808ddf2ac4d5cecb4b8543372abf3310285e54c8
  • develop default protected
  • production protected
  • nixpkgs-upgrade-2025-06-16
  • nixpkgs-upgrade-2024-12-23
  • 190-our-regular-updates-fill-up-the-servers-boot-partitions
  • nixpkgs-upgrade-2024-10-14
  • hro-cloud protected
  • 162.flexible-grafana-module
  • nixpkgs-upgrade-2024-05-13
  • nixpkgs-upgrade-2024-04-22
  • nixpkgs-upgrade-2024-03-25
  • nixpkgs-upgrade-2024-03-18
  • nixpkgs-upgrade-2024-03-11
  • nixpkgs-upgrade-2024-03-04
  • 163.jp-to-ben-for-prod
  • nixpkgs-upgrade-2024-02-26
  • 164.grafana-alert-rules
  • 157.authorize-new-hro-key
  • nixpkgs-upgrade-2024-02-19
  • nixpkgs-upgrade-2024-02-12
21 results

README.rst

Blame
  • README.rst 2.00 KiB

    Set up and use a network of local development VMs

    ... using Vagrant to manage VirtualBox VMs. (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.)

    This requires NixOS. Nix without the OS will not work.

    Use the local development environment

    1. Add VirtualBox to your NixOs system configuration at /etc/nixos/configuration.nix:

      virtualisation.virtualbox.host.enable = true;
      # Save bytes and build time, optional but recommended:
      virtualisation.virtualbox.host.headless = true;
    2. Enter the morph local grid directory:

      cd morph/grid/local
    3. Enter the project's nix-shell:

      nix-shell ../../../shell.nix
    4. Build and start the VMs:

      VAGRANT_DEFAULT_PROVIDER=virtualbox vagrant up
    5. Then, add the Vagrant SSH configuration to your user's ~/.ssh/config file:

      install -d ~/.ssh ; vagrant ssh-config >> ~/.ssh/config
    Latest Morph honors the SSH_CONFIG_FILE environment variable (since 3f90aa88 (March 2020, v 1.5.0)), so in the future this should get a bit more convenient.
    1. Create a public-keys/users.nix file with your SSH key (see public-keys/users.nix.example for the format) so you'll be able to log in after deploying the new configuration:

      $EDITOR public-keys/users.nix
    2. Then, build and deploy our software to the Vagrant VMs:

      morph build grid.nix
      morph push grid.nix
      morph deploy grid.nix boot
      vagrant halt
      vagrant up
      morph upload-secrets grid.nix
    You should now be able to log in with the users and keys you set in your users.nix file.