zefhemel/nixops-mac-setup
Script to easily setup Nix and NixOps for use on Mac
{ "createdAt": "2013-05-27T15:50:38Z", "defaultBranch": "master", "description": "Script to easily setup Nix and NixOps for use on Mac", "fullName": "zefhemel/nixops-mac-setup", "homepage": null, "language": "Shell", "name": "nixops-mac-setup", "pushedAt": "2015-05-19T07:19:33Z", "stargazersCount": 22, "topics": [], "updatedAt": "2022-06-22T02:51:02Z", "url": "https://github.com/zefhemel/nixops-mac-setup"}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
Section titled “Procedure”The script executes the following steps:
- Create a disk image with a case-sensitive file system and mount it at
/nix. - Install Nix and append environment variable setup to
~/.profile - Install NixOps
Requirements
Section titled “Requirements”- No Nix installed yet, clean system (Nix-wise)
- XCode command line tools installed (make, gcc etc.)
- Virtualbox (for deployments to VirtualBox)
- Git installed: http://git-scm.com/download/mac
First, configure VirtualBox (source):
- Start VirtualBox.
- Go to preferences (Cmd-,).
- Click on Network.
- If vboxnet0 is not present, add it by clicking the green +.
- Edit vboxnet0 and make sure DHCP Server is turned on. The settings I use are below.
- Server Address: 192.168.56.100
- Server Mask: 255.255.255.0
- Lower Address Bound: 192.168.56.101
- Upper Address Bound: 192.168.56.254
Then, check out this repository in a terminal and run the install script:
git clone git://github.com/zefhemel/nixos-mac-setup.gitcd nixos-mac-setup./install.shTo test:
nixops create test/trivial.nix test/trivial-vbox.nix --name testnixops deploy -d testAfter you reboot the NixStore.dmg will not automatically be remounted to mount it again, run ./attach-disk.sh again.
Resizing NixStore.dmg
Section titled “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 /nixhdiutil resize -size 50g NixStore.dmghdiutil attach NixStore.dmg -mountpoint /nix