NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.77k stars 1.52k forks source link

feat req: nix copy should respect --json #6107

Open colemickens opened 2 years ago

colemickens commented 2 years ago

Hi!

Nix's remote building story is getting pretty exciting. I can perform remote builds with a trusted user and deploy them (sans activation) with a relatively simple invocation:

  nix copy \
    --eval-store "auto" \
    --no-check-sigs \
    --from "ssh-ng://${remote}" \
    --to "ssh-ng://${target}" \
      "${thing}" >/dev/stderr
  nix eval --raw "${thing}" # needed to get the out path for activation

however, it does not seem that nix copy respects --json or any other way that I can capture copied paths. This means that for me to be able to then turn around and ssh-activate the toplevel, I need to eval again. For some derivations, even with caching, this is a bit painful.

colemickens commented 2 years ago

It would be nice for similar reasons to support --keep-going for this scenario where I'm triggering a large rebuild build and copy back in one shot.