Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where-to-build #26

Open
lheckemann opened this issue Sep 3, 2020 · 2 comments
Open

Where-to-build #26

lheckemann opened this issue Sep 3, 2020 · 2 comments

Comments

@lheckemann
Copy link

Vague wishlisty idea: being able to define where system derivations get built, rather than building them all on the local machine and then having to copy them to the target hosts. Uploading stuff via ADSL sucks.

A simple solution for this would be to allow copying the derivation over and building it on the target machine (or building it on the target machine without creating drv files on the other end; this seems to be possible nowadays?).

But there's all kinds of possibilities to explore in that space, like building on a powerful machine to deploy a tiny cloud server (and have the system derivation copied directly from the powerful machine to the tiny server). Or maybe integration with cachix and/or nix-build.net :^)

@colemickens
Copy link

@infinisil Are you interested in a contribution for this? I'm refactoring my script right that does this, and I'm realizing that it's already decently parameterized and could be potentially ported into nixus. Features would include: where to do the build, where to store the build product (if anywhere), how to realize the build (most of my hosts can realize directly from cachix, but some need to be nix copyd from the builder to an intermediate, and then pushed via a local ssh connection).

@infinisil
Copy link
Owner

I had a small IRC conversation on this with @lheckemann: https://logs.nix.samueldr.com/nixus/2020-09-03#1599163378-1599164356;

In short:

  • Currently Nixus works on the Nix level entirely: It's just a Nix expression that you nix-build directly. And Nix expressions themselves can't control how they're built.
  • One thing that might be possible is to do some builtins.unsafeDiscardOutputDependency hackery for only transferring a derivation closure to the target host and calling nix-build there. This doesn't sound like a good solution

It would be possible to write a nixus binary that does the nix-build calling, with which the build location and what-have-you-not could be controlled. This also wouldn't be the only reason for a proper nixus script. Though @bqv argued before that they really like the simplicity of it just being a Nix expression (and I like that too), so ideally I'd like to allow both using a script or the Nix expression directly (albeit with less features then).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants