-
Notifications
You must be signed in to change notification settings - Fork 83
Create nix flake #463
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
base: main
Are you sure you want to change the base?
Create nix flake #463
Conversation
|
I don't know anything about nix, @eddyb ? |
|
not maintainer --but I think forcing everyone to pull in the android toolchain might be a bit of an ask no? |
| { | ||
| devShells = { | ||
| default = pkgs.callPackage ./shell.nix { inherit rustToolchain; }; | ||
| android = pkgs.callPackage ./android.nix { inherit rustToolchain; }; |
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.
@alphastrata This means you need to run nix develop .#android to get a dev shell with android, otherwise it'll just use default. (Though it wouldn't allow you to run the examples locally, since it's missing the deps that shell.nix provides... Maybe we should treat android as a purely additive thing?)
It looks good to me, but I'm not super familiar with nix myself, so I'll get @eddyb review it as well.
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.
Ahh I see. ty.
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'm not sure for what the android.nix was used for, I am assuming just to cross compile to android? If so, I think it's fine that it won't allow to run the examples per default as it was already like this before.
|
One thing I am not sure about yet is how the rust-overlay flake input can be automatically updated when upgrading to a newer toolchain without forcing someone to use nix. With these changes, every time the rust toolchain is being updated, it would be necessary to run "nix flake update rust-overlay" as well to make sure the new toolchain version is known to nix. |
I have created a nix flake, that will fetch the required rust toolchain using rust-overlay.
By doing this, the toolchain does not need to be installed into the user environment directly.
I also added an
.envrc, this will allow to directly drop into a devshell if eg. direnv is used.