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

nixos/nix: allow specifying a protocol for a remote-builder when using pkgs.nixUnstable #100756

Closed
wants to merge 1 commit into from

Conversation

Ma27
Copy link
Member

@Ma27 Ma27 commented Oct 16, 2020

Motivation for this change

When using nixUnstable by default, it's possible to specify a protocol for a build-machine (e.g. ssh-ng). This PR adds support for that and ensures that this only happens if Nix>=3.0 is used as nixStable doesn't support this.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@Ma27
Copy link
Member Author

Ma27 commented Oct 26, 2020

Now checking against Nix 2.4 after NixOS/nix@ac0e24f

@edolstra do you think this is good to go then?

@edolstra
Copy link
Member

Instead of adding a protocol field, it might be better to add a storeURL field or something like that (as an alternative to hostName), to be fully general. Some remote builder protocols might not have a hostname (e.g. IIRC the AWS builder takes an SQS queue name).

@Ma27
Copy link
Member Author

Ma27 commented Oct 26, 2020

@edolstra could you give me an example for that? I'm not sure if that's really a better idea though as this would conflict with things like sshUser as well (which means that if you need to specify an alternative protocol for a machine, you'd have to change the full URL).

@edolstra
Copy link
Member

An example is chroot stores in NixOS containers where /nix/store is not writable. In that case the store URL is just a path.

sshUser and sshKey are obsolete when you specify a full store URL since you can just include them in the URL (e.g. ssh://user@example.org?ssh-key=/path).

@Ma27
Copy link
Member Author

Ma27 commented Oct 26, 2020

Just realized that I wrongly assumed that specifying a protocol is only possible on nixUnstable. In fact it's sufficient to set hostName to e.g. ssh-ng://hostname, hence this change isn't needed. Sorry for that, will close it now.

@Ma27 Ma27 closed this Oct 26, 2020
@Ma27 Ma27 deleted the build-machines-protocol branch October 26, 2020 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants