Port build system to Nix