-
Notifications
You must be signed in to change notification settings - Fork 81
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
Use crate2nix generate for third-party projects #291
Comments
I don't think so. The This issue is explicitly about packaging something for which I don't have the checkout locally, but pull sources via Nix (via A more graspable and similar example (even though that's not the goal here) would be "have a mode of operation to use crate2nix to generate a Cargo.nix from a third-party repo" - assuming we could commit |
Well, the title is: "Handling out-of-tree sources" Even though it is a while ago that I wrote this, the intention was exactly supporting "out of tree" sources as you describe. The examples add binaries which sources are fetches from cratesIo. But it can also fetch from github as mentioned.
You can
|
I'm not sure what workflow I had in mind here, but that process indeed works. Sorry for the noise, and thanks :-) |
I was also confused by the workflow when looking at it again after years 😊 a nicer workflow could be possible with IFD or dynamic derivations… |
IFD makes it harder to debug the emitted intermediate nix code, and dynamic derivations are still experimental (and I'm not convinced I like them ;-) ). Anyways :-D |
I ran into this again today! Opened #316 with a reproducer, using the workflow described here. |
I ran into another FOD-related issue when packaging some rust project, and would really like to be able to use
crate2nix
to package "external" projects.While it's possible to invoke
crate2nix generate
with a-f
pointing to an external path, the underlying attrset insideinternal
has asrc
pointing to some weirdsrc
(in my case, a relate path up to my/
, and then descending down into/nix/store
, which will make theCargo.nix
file not portable.This is only the case for the crate/workspace that the
Cargo.nix
is created for, not dependencies.While this approach works fine for monorepos, when
crate2nix generate
is executed alongside the sources, and the file is staying there, it doesn't work good for "external projects".It'd be nice if
crate2nix generate
had some "external project mode", in which it does not writesrc
for the root crate/workspace, but asks for a mandatory toplevelsrc
argument.The text was updated successfully, but these errors were encountered: