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
kicad: add option to override footprint, symbol and 3d model locations #85456
Conversation
Another comment: the whole kicad expression is really tough to override. For instance, changing So it seems like the easiest way to use a git version or local path for src is to copy the whole expression, edit it to use the local repo, and then call that build expression. |
I'm closing this as I'm not convinced my PR is a good idea and my comment without an associated patch isn't super useful. I do think there are problems with this package expression that should be addressed, but I'll hold off until I have some actual changes that others can review. Of course if you disagree feel free to reopen. |
huh, not sure why i wasn't added as a reviewer i did not consider ease of use of mixed components i overhauled most of the kicad package a while ago but didn't receive much feedback @matthuszagh if you end up reviewing the package, please tag me, or try me on IRC |
@evils I'm reopening this, and will fix merge conflicts. I'd like to get your input. I know you mentioned that you would override versions.nix. However, because versions is imported in a let block, I don't see a way to overlay this. Maybe I'm missing something easy though? Additionally, and more importantly in my mind, this still suffers from the library files not being writable. Adding path arguments, as this PR does, provides a simple way to get either behavior (yours by default). Do you see any significant downside to it? |
3e8b93c
to
1dd7c6b
Compare
i meant my approach if i wanted to mix and match libraries would be to edit the
as long as the library files are distributed by nix, that's always going to be the case?
if it fulfills the needs of a user that is not met by the current package, it's probably worth a bit of 'clutter' |
Thanks for the feedback @evils!
Agreed, and that makes sense. The nice thing about this PR is kicad doesn't need the actual files, it just needs the path string so doing this doesn't create any purity issues. For instance, I'm using this with flakes and it works fine.
Yes, that it does. |
f1180a2
to
2bf4060
Compare
2bf4060
to
e328722
Compare
Rebased for this PR. |
@doronbehar if you don't mind, it would be great to get your feedback on this PR too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I take back my approval.
34830c2
to
5180455
Compare
@doronbehar changes done. Let me know. |
4aa636c
to
e0ce513
Compare
@matthuszagh, this is all wrong, because nixpkgs/pkgs/build-support/setup-hooks/make-wrapper.sh Lines 18 to 19 in 62e6142
So I'd suggest to make this PR do nothing besides switching the |
Previously, these library locations were set absolutely. This prevented overriding their locations with environment variables. Now, setting the corresponding environment variable will override the setting in the environment wrapper. For instance, I can set KISYSMOD=/some/path/to/footprints and this will be used as my footprint library instead of the default footprint library in the nix store. This feature is particularly useful for having kicad libraries which are writable.
e0ce513
to
9320c69
Compare
@doronbehar change done. |
Thanks for your contribution. |
Motivation for this change
This PR makes it easy to supply custom library locations, which is useful when working on the libraries or using a git version.
I'm not really sure what the standard nixpkgs practice is here. I like this solution because it makes it really easy to work on the various libraries or use a git version. As I see it, the two main alternatives to this are:
I don't like option 1 because correctly doing this with an overlay does not seem trivial, although maybe someone better at Nix will show me why it's easy. I'm also not a fan of option 2 because the GUI options don't allow you to specify a path that Kicad looks in for the libraries. Rather, you have to specify each library/footprint file individually which is a lot of unnecessary work when doing a lot of work on the kicad libraries. Option 2 also doesn't help when you want to use the git master version of a library.
What are people's thoughts on this?
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)