File tree Expand file tree Collapse file tree 3 files changed +104
-0
lines changed
Expand file tree Collapse file tree 3 files changed +104
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ description = "Devmoji git log" ;
3+
4+ inputs = {
5+ nixpkgs . url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz" ;
6+ rust-overlay = {
7+ url = "github:oxalica/rust-overlay" ;
8+ inputs . nixpkgs . follows = "nixpkgs" ;
9+ } ;
10+ } ;
11+
12+ outputs = {
13+ self ,
14+ nixpkgs ,
15+ rust-overlay ,
16+ } : let
17+ supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ] ;
18+ forEachSupportedSystem = f :
19+ nixpkgs . lib . genAttrs supportedSystems ( system :
20+ f {
21+ pkgs = import nixpkgs {
22+ inherit system ;
23+ overlays = [ rust-overlay . overlays . default self . overlays . default ] ;
24+ } ;
25+ } ) ;
26+ in {
27+ overlays . default = final : prev : {
28+ rustToolchain = let
29+ rust = prev . rust-bin ;
30+ in
31+ if builtins . pathExists ./rust-toolchain.toml
32+ then rust . fromRustupToolchainFile ./rust-toolchain.toml
33+ else if builtins . pathExists ./rust-toolchain
34+ then rust . fromRustupToolchainFile ./rust-toolchain
35+ else
36+ rust . stable . latest . default . override {
37+ extensions = [ "rust-src" "rustfmt" ] ;
38+ } ;
39+ } ;
40+
41+ devShells = forEachSupportedSystem ( { pkgs } : {
42+ default = pkgs . mkShell {
43+ packages = with pkgs ; [
44+ rustToolchain
45+ rust-analyzer
46+ ] ;
47+
48+ env = {
49+ # Required by rust-analyzer
50+ RUST_SRC_PATH = "${ pkgs . rustToolchain } /lib/rustlib/src/rust/library" ;
51+ } ;
52+ } ;
53+ } ) ;
54+ } ;
55+ }
Original file line number Diff line number Diff line change 1+ [toolchain ]
2+ channel = " stable"
3+ components = [ " rust-analyzer" ]
You can’t perform that action at this time.
0 commit comments