zefhemel / nixops-mac-setup

Script to easily setup Nix and NixOps for use on Mac
22 stars 6 forks source link

Simple one-off script to download and install Nix and NixOps and make it to prepare it for deployments on Mac. Inspired by these instructions.

Procedure

The script executes the following steps:

  1. Create a disk image with a case-sensitive file system and mount it at /nix.
  2. Install Nix and append environment variable setup to ~/.profile
  3. Install NixOps

Requirements

Use

First, configure VirtualBox (source):

Then, check out this repository in a terminal and run the install script:

git clone git://github.com/zefhemel/nixos-mac-setup.git
cd nixos-mac-setup
./install.sh

To test:

nixops create test/trivial.nix test/trivial-vbox.nix --name test
nixops deploy -d test

After you reboot the NixStore.dmg will not automatically be remounted to mount it again, run ./attach-disk.sh again.

Resizing NixStore.dmg

By default the NixStore.dmg file is 10G which should be enough for a while, if you want resize it, play with these commands:

hdiutil detach /nix
hdiutil resize -size 50g NixStore.dmg
hdiutil attach NixStore.dmg -mountpoint /nix