File tree Expand file tree Collapse file tree 4 files changed +153
-14
lines changed Expand file tree Collapse file tree 4 files changed +153
-14
lines changed Original file line number Diff line number Diff line change
1
+ use flake
Original file line number Diff line number Diff line change 1
- # Generated by Cargo
2
- # will have compiled files and executables
3
- /target /
4
-
5
- # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
6
- # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
7
- Cargo.lock
8
-
9
- # These are backup files generated by rustfmt
10
- ** /* .rs.bk
11
-
12
- ** /.idea /*
13
-
14
- ** /main.rs
1
+ target /**
2
+ .direnv /**
Original file line number Diff line number Diff line change
1
+ {
2
+ inputs = {
3
+ nixpkgs . url = "github:NixOS/nixpkgs/nixpkgs-unstable" ;
4
+ fenix . url = "github:nix-community/fenix" ;
5
+ fenix . inputs . nixpkgs . follows = "nixpkgs" ;
6
+ flake-utils . url = "github:numtide/flake-utils" ;
7
+ } ;
8
+
9
+ outputs =
10
+ {
11
+ nixpkgs ,
12
+ fenix ,
13
+ flake-utils ,
14
+ ...
15
+ } :
16
+ flake-utils . lib . eachDefaultSystem (
17
+ system :
18
+ let
19
+ pkgs = import nixpkgs {
20
+ inherit system ;
21
+ } ;
22
+
23
+ # https://github.com/nix-community/fenix/issues/178
24
+ cargo = fenix . packages . ${ system } . stable . cargo . overrideAttrs ( old : {
25
+ postBuild = pkgs . lib . optionalString pkgs . stdenv . isDarwin ''
26
+ cargo="./cargo/bin/cargo"
27
+ install_name_tool \
28
+ -change "/usr/lib/libcurl.4.dylib" "${ pkgs . curl . out } /lib/libcurl.4.dylib" \
29
+ "$cargo"
30
+ '' ;
31
+ } ) ;
32
+ rustToolchain =
33
+ with fenix . packages . ${ system } ;
34
+ combine [
35
+ cargo
36
+ stable . rustc
37
+ stable . clippy
38
+ stable . rustfmt
39
+ ] ;
40
+ in
41
+ {
42
+ devShells . default = pkgs . mkShell {
43
+ buildInputs = with pkgs ; [
44
+ rustToolchain
45
+ rust-analyzer
46
+ ] ;
47
+ } ;
48
+ }
49
+ ) ;
50
+ }
You can’t perform that action at this time.
0 commit comments