Open DavHau opened 1 year ago
The deployment builds the system locally and nix-copy-closures it to the target
I guess to deploy on foreign platforms we'd need to introduce a remote build strategy anyways. If so, maybe we can make this the default once we have it. Copying the flake to the remote host and building it there would do the job, I guess?
Remote building isn't supported yet - and I believe it might require some form of plugin/hook system.
A workaround might be to use nixos-anywheres --from
parameter to pull from a remote store. That still requires you to push your system closure to said store first, but that could be done from a dedicated builder
we use -s
in the copy closure, so we try to get most of the stuff from the binary cache. but this misses a lot of dependencies ofc. I'm usually nixos-remoting from a server, so everything works fast. I guess that is the best approach here? Maybe we can have an option for remote evaluation? but I guess we basically want to support what nixos-rebuild supports
But those are public caches by default, unless you set trusted-substituters via --option? --from
would be what allows you to refer to your own remote nix store here. That store could contain your whole system closure, put there e.g. by your builder. In that case it shouldn't miss any dependencies, unless I am mistaken?
Tip: If nix copy
is slow, maybe consider using this trick (export + ssh + zstd + unzstd + import): https://github.com/divnix/std-action/blob/main/run/action.yaml#L116-L122
Tip: If
nix copy
is slow, maybe consider using this trick (export + ssh + zstd + unzstd + import): https://github.com/divnix/std-action/blob/main/run/action.yaml#L116-L122
FYI, the “trick” you linked is gone from current versions of that repo. I'm guessing you were referring to that revision?
--option substituters "https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store" don't work
Always use https://cache.nixos.org
Describe the bug
The deployment is quite slow for me, likely because the derivations are built using the nix remote build protocol which is very sensitive to network delay.