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

eachDefaultSystem docs are sorely missing a real example #94

Open
colemickens opened this issue May 11, 2023 · 4 comments
Open

eachDefaultSystem docs are sorely missing a real example #94

colemickens opened this issue May 11, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@colemickens
Copy link

I'm very unconvinced about using a flake import to override the systems that "eachDefaultSystem" is going to build for. I love flakes but seeing inputs used for this seems confusing to me.

Further, I've been looking at/for examples, etc, and have no idea how to get jj (https://github.com/martinvonz/jj) to support riscv64-linux.

@colemickens colemickens added the bug Something isn't working label May 11, 2023
@colemickens
Copy link
Author

This pattern is throwing up red flags for me. Least of all, overriding a transitive dependency with a path doesn't seem to work.

I have:

{
 systems = { url = "path:./flake.systems.nix"; flake = false; };
 jj = { url = "github:martinvonz/jj"; inputs."flake-utils".inputs."systems".follows = "system"; };
}

and I can see from reading the lock file that the override is not working.

@colemickens
Copy link
Author

I guess I can override flake-utils, with it's system overridden, and then pass that to jj as an override, but ... this is going to get hairy fast. So this sorta works:

{
    systems = { url = "path:./flake.systems.nix"; flake = false; };
    flake-utils = { url = "github:numtide/flake-utils"; inputs."systems".follows = "systems"; };
    jj = { url = "github:martinvonz/jj"; inputs."flake-utils".follows = "flake-utils"; };
}

Now I have multiple (enough, really) flake-utils through my flake.lock, but now I also have this version that is slightly different. Now I have to decide if I override every potential flake input that consume flake-utils.

Also, a question -- should I have been able to override that dependency transitively?

@zimbatm
Copy link
Member

zimbatm commented Aug 23, 2023

I think your last example is the right way to do it, given the current design constraints of flakes.

The best is to flatten the inputs as much as possible so there is only one version of each dependency.

@Moise225
Copy link

latest.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants