I only recently encountered home-manager, so forgive me if this is out of scope. I鈥檓 thinking it would be nice to let home-manager take care of rust toolchains, i.e., something like this:
programs.rustup = {
enable = true;
toolchains = {
stable = {
components = [ "clippy"];
};
};
defaultToolchain = "stable";
};
I鈥檓 not so sure about overrides. There is also the question of how home-manager generations would interact with toolchain updates.
I use a nix-shell with direnv to do this
moz_overlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz);
nixpkgs = import <nixpkgs> { overlays = [ moz_overlay ]; };
rustNightlyChannel = (nixpkgs.rustChannelOf { date = "2019-01-26"; channel = "nightly"; }).rust;
rustStableChannel = nixpkgs.latest.rustChannels.stable.rust.override {
extensions = [
"rust-src"
"rls-preview"
"clippy-preview"
"rustfmt-preview"
];
};
in
with nixpkgs;
stdenv.mkDerivation {
name = "moz_overlay_shell";
buildInputs = [
rustNightlyChannel
];
}
I'm not familiar with rustup but if this module would configure rustup in some way then it seems to me a good fit 馃檪
@dali99 Hi and thank you. Can you provide your solution as a PR?
@LinArcX The solution isnt a special thing for home-manager. it's a basic nix shell. That can be loaded via direnv, by including it in the folder of your project.
So should this issue be closed with the motivation that nix-shell is the better choice?
Probably, yes.
What about using https://github.com/mozilla/nixpkgs-mozilla ?
Most helpful comment
I use a nix-shell with direnv to do this