nanonixos
Documentation
Not logged in

How I use this

Get a copy of this repository:

fossil clone http://vicerveza.homeunix.net/~viric/cgi-bin/nanonixos nanonixos.fossil
mkdir nanonixos
fossil open ../nanonixos.fossil

Get a checkout of nixpkgs stdenv-updates:

svn co https://svn.nixos.org/repos/nix/nixpkgs/branches/stdenv-updates

Then make your environment variable NANONIXOS_NIXPKGS point to where you have stdenv-updates.

Then you can get qemu running the ubifs image of nanonixos by:

nix-build -A emulate
sh emulate

Prepare an image for the nanonote

nix-build -A kernelImage
nix-build -A ubootImage
nix-build -A rootfsImage

How to update a running installation

STOREPATH=`nix-build -A activate`
# (note the result of the command above, a store path)
nix-store --export `nix-store -qR $STOREPATH` | ssh root@IP "nix-store --import"
ssh root@IP $STOREPATH
# To keep the activate script as gcroot
ssh root@IP ln -sf $STOREPATH /activate

A more clever approach (more as a personal note):

ssh root@nanonote "NIX_ROOT_FINDER= nix-store --gc --print-live" > list2
nix-store -qR result | ( while read A; do grep -q $A list2 || echo $A ; done ) > list3
nix-store --export `cat list3` | ssh root@nanonote "nix-store --import"

Garbage collection

nix-store calls some perl script that we can't run until we cross-build perl, to find the runtime gcroots. But we can skip it this way:

NIX_ROOT_FINDER= nix-store --gc