I’m hoping someone can assist with either correcting a misunderstanding on my part or perhaps, see something I missed and point me in the right direction.
A bit of context:
LocalHost: NixOS 23.05 (x86_64-linux), installed using a flake (has no /etc/configuration.nix)
RemoteHost: Raspberry Pi 4 (aarch64-linux), only freshly booted from a recent 23.05 hydra installer image, slightly modified with authorized_keys for headless setup
My goal was to use nixos-rebuild
from my LocalHost machine, using a configuration.nix file as documented here and specifying both the build-host and target-host as user@remote_ip
It seems no matter what I attempt, I always end up copying some 6700 drvs from the LocalHost to the RemoteHost, rather than telling the RemoteHost to build itself from the configuration.nix file I’m attempting to supply to it.
I’ve tried:
nixos-rebuild -I nixos-config=$(pwd)/configuration.nix --build-host user@remote_ip --target-host user@remote_ip --fast --use-remote-sudo switch
This ends up failing after copying a bunch of stuff from my LocalHost /nix/store saying nix-store -I argument unknown
(or something to that effect)
I’ve also tried:
(export NIX_PATH=nixos-config=$(pwd)/configuration.nix ; nixos-rebuild --build-host user@remote_ip --target-host user@remote_ip --fast --use-remote-sudo switch)
This just fails because it tries to build a drv that says requires “x86_64-linux with features {}”, as opposed to the “aarch64-linux with features…”
Ideally, my goal here was to fresh boot my raspberry pi(s), “initialize” them using a basic configuration.nix, basically enabling flake support, and then rebuilding using the appropriate flake configuration.
Any help would be appreciated; whether that is directly related to my initial goal, or recommending an alternative