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

Add flake examples for cross-compilation #163

Closed
holly-hacker opened this issue Mar 30, 2024 · 2 comments · Fixed by #177
Closed

Add flake examples for cross-compilation #163

holly-hacker opened this issue Mar 30, 2024 · 2 comments · Fixed by #177
Labels
enhancement New feature or request

Comments

@holly-hacker
Copy link

For the past hour I've been trying to convert the cross-aarch64 example to a flake, to no avail. It'd be nice if an example of this was provided.

@oxalica
Copy link
Owner

oxalica commented Jun 2, 2024

cross-aarch64 example to a flake

I don't think the current flake design supports cross-compilation without re-importing nixpkgs with a custom config, which also opt-out flake benefits like eval-caching. There are issues NixOS/nix#5157 and blogs about the current state of cross-compilation for flakes.

Alternatively to the re-importing with config/overlay solution, we can also provide a builder interface for rust-overlay to be used as (rust-overlay.lib.mkRustBin nixpkgs.legacyPackages.pkgsCross.aarch64-multiplatform).stable.latest. This will re-instantiate only rust-overlay packages rather than all nixpkgs packages. It still cannot use eval-cache and will instantiate every time for each flake input using rust-overlay, but at least it's the lesser of two evils.

The second solution is also mentioned in #94 (comment)

@holly-hacker
Copy link
Author

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants