I am on host a
, and I have the derivation for a host I want to deploy locally:
$ nix path-info --derivation .#nixosConfigurations.loogle.config.system.build.toplevel
/nix/store/bwpbwbrm4sni09gwqwapvdi3z46g0711-nixos-system-loogle-23.11.20230606.af21c31.drv
I do not have the output locally:
$ nix show-derivation /nix/store/bwpbwbrm4sni09gwqwapvdi3z46g0711-nixos-system-loogle-23.11.20230606.af21c31.drv | jq -r '.[].outputs.out.path'
/nix/store/mb13r407vhf3gy4vj9b6nvizmgjm64p8-nixos-system-loogle-23.11.20230606.af21c31
# ls /nix/store/mb13r407vhf3gy4vj9b6nvizmgjm64p8-nixos-system-loogle-23.11.20230606.af21c31
ls: cannot access '/nix/store/mb13r407vhf3gy4vj9b6nvizmgjm64p8-nixos-system-loogle-23.11.20230606.af21c31': No such file or directory
But it is available in a substituter:
$ nix store ls -d --store https://cache.garnix.io /nix/store/mb13r407vhf3gy4vj9b6nvizmgjm64p8-nixos-system-loogle-23.11.20230606.af21c31
.
How can I invoke nixos-rebuild
so that
- the derivation isn’t pushed to the other side (no need to pull in all the sources it depends upon)
- the output path is fetched from the substituter (which is configured remotely)
It seems that
nixos-rebuild switch --use-substitutes --target-host root@loogle.nomeata.de --flake .#loogle --fast
will pointlessly build the system locally (by fetching it from the substitutor), while
nixos-rebuild switch --use-substitutes --build-host root@loogle.nomeata.de --target-host root@loogle.nomeata.de --flake .#loogle --fast
insists on (pointlessly) uploading the .drv
to the remote host first.