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

jobs.nix is unnecessary and restrictive #11

Open
ElvishJerricco opened this issue Oct 15, 2017 · 2 comments
Open

jobs.nix is unnecessary and restrictive #11

ElvishJerricco opened this issue Oct 15, 2017 · 2 comments

Comments

@ElvishJerricco
Copy link

nix-instantiate can handle nix expressions that are attribute sets of other derivations just fine, so ci.nix can just be passed directly instead of preprocessing it with jobs.nix. This is nice because the user can organize their ci.nix however they want; e.g. they can have it return a list or just a single derivation, and nix-instantiate will handle it fine.

The problem is recursive attribute sets. jobs.nix handles this currently, but it's a little ad-hoc and gross. The more proper way to support this is to just require them to use recurseIntoAttrs if they want a nested ci.nix:

with import <nixpkgs> {}; {
  a = drv1;
  b = recurseIntoAttrs {
    c = drv2;
    d = recurseIntoAttrs {
      e = drv3;
    };
  };
}

This works with nix-instantiate out of the box. No jobs.nix required.

@ocharles
Copy link
Owner

I'm not entirely following (I never said jobs.nix was necessary, it's there simply as it's sufficient to implement what I wanted). If you think you have something similar, I will happily take a PR. It might be easier to discuss this one over code.

@ocharles
Copy link
Owner

Oh, I think you're saying I don't need to do any processing of ci.nix. If that's true, that does indeed sound desirable.

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

2 participants