Fix Rust Analyzer
Previously we had warnings about sysroot, and limited feedback. This fix is from the Crane docs section about building standard library crates.
This commit is contained in:
parent
a81d622125
commit
23c0777425
21
flake.lock
generated
21
flake.lock
generated
@ -609,7 +609,28 @@
|
||||
"nixpkgs": [
|
||||
"haskellNix",
|
||||
"nixpkgs-unstable"
|
||||
],
|
||||
"rust-overlay": "rust-overlay"
|
||||
}
|
||||
},
|
||||
"rust-overlay": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1764816035,
|
||||
"narHash": "sha256-F0IQSmSj4t2ThkbWZooAhkCTO+YpZSd2Pqiv2uoYEHo=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "74d9abb7c5c030469f90d97a67d127cc5d76c238",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"stackage": {
|
||||
|
||||
14
flake.nix
14
flake.nix
@ -3,7 +3,11 @@
|
||||
inputs.nixpkgs.follows = "haskellNix/nixpkgs-unstable";
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
inputs.crane.url = "github:ipetkov/crane";
|
||||
outputs = { self, nixpkgs, flake-utils, haskellNix, crane }:
|
||||
inputs.rust-overlay = {
|
||||
url = "github:oxalica/rust-overlay";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
outputs = { self, nixpkgs, flake-utils, haskellNix, crane, rust-overlay }:
|
||||
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
|
||||
let
|
||||
overlays = [
|
||||
@ -15,10 +19,16 @@
|
||||
evalSystem = "x86_64-linux";
|
||||
};
|
||||
})
|
||||
(import rust-overlay)
|
||||
];
|
||||
pkgs = import nixpkgs { inherit system overlays; inherit (haskellNix) config; };
|
||||
haskell = pkgs.hixProject.flake { };
|
||||
rust = crane.mkLib pkgs;
|
||||
rust = (crane.mkLib pkgs).overrideToolchain (p: p.rust-bin.selectLatestNightlyWith (
|
||||
toolchain: toolchain.default.override {
|
||||
extensions = [ "rust-src" ];
|
||||
targets = [ "x86_64-unknown-linux-gnu" ];
|
||||
}
|
||||
));
|
||||
in
|
||||
{
|
||||
devShells.default = pkgs.mkShell {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user