Skip to content

Commit

Permalink
rust: Add rust-analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
akirak committed Oct 8, 2023
1 parent 4196d9c commit de91561
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions rust/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,27 @@
})
);

rustToolchain = eachSystem (pkgs: pkgs.rust-bin.stable.latest.default);

treefmtEval = eachSystem (pkgs: treefmt-nix.lib.evalModule pkgs ./treefmt.nix);
in {
devShells = eachSystem (pkgs: {
default = pkgs.mkShell {
buildInputs = with pkgs; [
rust-bin.stable.latest.default
# Based on a discussion at https://github.com/oxalica/rust-overlay/issues/129
default = pkgs.mkShell (with pkgs; {
nativeBuildInputs = [
clang
# Use mold when we are runnning in Linux
(lib.optionals stdenv.isLinux mold)
];
buildInputs = [
rustToolchain.${system}
rust-analyzer-unwrapped
cargo
# pkg-config
# openssl
];
};
RUST_SRC_PATH = "${rustToolchain.${system}}/lib/rustlib/src/rust/library";
});
});

formatter = eachSystem (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper);
Expand Down

0 comments on commit de91561

Please sign in to comment.