From 6e2645368926aaa93067b19109c919c21c445424 Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Fri, 8 Nov 2019 15:41:02 +0100 Subject: [PATCH] Set default size of the virtualbox machine disk This eliminates the manual resize step in vbox deployment --- docs/install.md | 14 +++++--------- network/network-vbox.nix | 9 ++++++--- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/docs/install.md b/docs/install.md index 39fdd89..903ac0f 100644 --- a/docs/install.md +++ b/docs/install.md @@ -118,15 +118,7 @@ You can also build Nix from source by following the instructions at https://nixo This will now create a nix-bitcoin node on the target machine. -6. Resize the virtualbox disk - - ``` - ./contrib/vbox-resize-disk1.sh - ``` - - NixOps provides a virtualbox disk thats 50gb in size, but we need more than that to house the Bitcoin blockchain. By default, this script will resize the disk to 350gb. Run it with `-h` to see options. Make sure to run this from within your nix-shell. - -7. Nixops automatically creates an ssh key for use with `nixops ssh`. Access `bitcoin-node` through ssh in nix-shell with +6. Nixops automatically creates an ssh key for use with `nixops ssh`. Access `bitcoin-node` through ssh in nix-shell with ``` nixops ssh operator@bitcoin-node @@ -134,6 +126,10 @@ You can also build Nix from source by following the instructions at https://nixo See [usage.md](usage.md) for usage instructions, such as how to update. +To resize the VM disk image, you can use this helper script from within nix-shell: +``` +./contrib/vbox-resize-disk1.sh --help +``` ---- Tutorial: install and configure NixOS for nix-bitcoin on VirtualBox (macOS host) diff --git a/network/network-vbox.nix b/network/network-vbox.nix index 24aac38..2f75481 100644 --- a/network/network-vbox.nix +++ b/network/network-vbox.nix @@ -3,8 +3,11 @@ { config, pkgs, ... }: { deployment.targetEnv = "virtualbox"; - deployment.virtualbox.memorySize = 4096; # megabytes - deployment.virtualbox.vcpu = 4; # number of cpus - deployment.virtualbox.headless = true; + deployment.virtualbox = { + memorySize = 4096; # megabytes + vcpu = 4; # number of cpus + disks.disk1.size = 358400; # 350 GiB + headless = true; + }; }; }