-
I recently stumbled upon devShells.default =
pkgs.mkShell.override {
stdenv = pkgs.stdenvAdapters.useMoldLinker pkgs.stdenv;
} {
packages =
nativeBuildInputs
++ buildInputs
++ (with pkgs; [cargo-watch cargo-outdated]);
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
# other env variables ...
}; (full flake here, currently using naersk) but I can't simply replace What's the best way to go about a similar setup with crane? The goal is to have a development shell that compiles with rustc-codelift (done, easy with fenix) and uses Lots of thanks in advance~! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @muni-corn! Two insights which might be helpful here:
devShells.default = (craneLib.devShell.override {
mkShell = pkgs.mkShell.override {
stdenv = pkgs.stdenvAdapters.useMoldLinker pkgs.stdenv;
};
}) {
packages = [ /* ... */ ];
}; |
Beta Was this translation helpful? Give feedback.
Hi @muni-corn! Two insights which might be helpful here:
craneLib.devShell
is basically a shortcut for includingrustc
/cargo
/clippy
/rustfmt
from the toolchain declaration but it isn't strictly required; you can always usepkgs.mkShell
directly (and pull in the toolchain override [if any] in there)craneLib.devShell
takes amkShell
input, so in theory you could override it like so: