I’m using nixops to deploy various ”little” machines at home. Some of them should not have an internet connection. Is it possible (maybe with some flags I couldn’t find) to deploy to those “offline” machines? The “build machine” has internet and could download all the nar files and then push them to the machines. AFAICT all machines download the nar files again and again, is this true?
When I try to deploy to those machines, I see these messages:
warning: unable to download 'https://cache.nixos.org/94shd2jl71af2yz95da52w98m2wl1r8g.narinfo': Couldn't connect to server (7); retrying in 320 ms
you can change the NIX_PATH var on the deployment specification to point to a local copy of nixpkgs.
nix.nixPath = [ “…” ]; is one way (edit: nixPath is a list of strings not just a string)
Take a look at the nixos-rebuild man page.
The flags --build-host and --target-host should be what you are looking for.
Also you can specify the nixos-config and nixpkgs channel through the -I flag. (take a look at the NIX_PATH environment variable)