I've been giving this a try, but I'm at a total loss. There's lots of bits and hints that its possible, and may even work quite well, but they seem to be from different eras and are generally incomplete. There was apparently a wiki at one point, but that vanished meaning that links from all over the internet to it are broken; that doesn't help either.
I've been following
these instructions as suggested by
this reddit comment.
So far, I've:
* Managed to install nix itself. I can use `nix-env` and friends. I've used these tools to build GNU hello and nix-repl so they seem to be working.
* I coped /etc/nixos/configuration.nix and tweeked the partitions as they didn't quite match.
I get stuck here
```
export NIXOS_CONFIG=/etc/nixos/configuration.nix
nix-env -i \
-A config.system.build.nixos-install \
-A config.system.build.nixos-option \
-A config.system.build.nixos-generate-config \
-j 4 --cores 4 -f "nixpkgs/nixos" # Set 4 to the cores you have.
```
However, it complains about infinite recursion (
output on pastbin as it's quite large). I've tried a few values of the -f argument including omitting it and pointing it at a checked out nix packages repo. Nothing really seems to work. I think what this step is trying to accomplish is to building nixos-install and co. I can't find any nixos-install on any of the package searches (though there seem to be plenty of other invisible packages).
Also, I've managed stumble on these:
Which seem very suggestive. Would I be better off trying to work out how to nix-build them somehow? The command in the comment doesn't seem to work (working directory is the root of the nixpkgs git repo).
pi@raspberrypi:~/nixpkgs $ nix-build nixos -I nixos-config=nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix -A config.system.build.sdImage
error: attribute ‘sdImage’ in selection path ‘config.system.build.sdImage’ not found