use oxalica's rust-overlay

This commit is contained in:
Adithya 2023-12-09 12:52:56 +05:30
parent 117771bb45
commit 334d28540a
Signed by: adtya
GPG key ID: 48FC9915FFD326D0
3 changed files with 37 additions and 3 deletions

View file

@ -37,7 +37,31 @@
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1702088052,
"narHash": "sha256-FkwIBTAMsxyceQce0Mbm+/+cOjj2r5IHBK4R/ekPNaw=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "2cfb76b8e836a26efecd9f853bea78355a11c58a",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"systems": {

View file

@ -4,12 +4,20 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
};
outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system:
outputs = { self, nixpkgs, flake-utils, rust-overlay }: flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlays.default ];
};
in
{

View file

@ -1,5 +1,7 @@
{ pkgs }: pkgs.mkShell {
packages = with pkgs; [ cargo rustc rustfmt rust-analyzer ];
buildInputs = with pkgs; [
(rust-bin.stable.latest.default.override { extensions = [ "rust-src" "rust-analyzer" ]; })
];
shellHook = ''
export CARGO_HOME=$PWD/.nix/cargo
export PATH=$CARGO_HOME/bin:$PATH