File tree 5 files changed +110
-11
lines changed 5 files changed +110
-11
lines changed Original file line number Diff line number Diff line change 5
5
url = "github:ipetkov/crane" ;
6
6
inputs . nixpkgs . follows = "nixpkgs" ;
7
7
} ;
8
+ fenix = {
9
+ url = "github:nix-community/fenix" ;
10
+ inputs . nixpkgs . follows = "nixpkgs" ;
11
+ } ;
8
12
} ;
9
13
10
14
outputs = {
11
15
self ,
12
16
nixpkgs ,
13
17
crane ,
18
+ fenix ,
14
19
} : let
15
20
forEachSystem = nixpkgs . lib . genAttrs [
16
21
"aarch64-darwin"
21
26
in {
22
27
packages = forEachSystem ( system : let
23
28
craneDerivations = nixpkgs . legacyPackages . ${ system } . callPackage ./nix/default.nix {
24
- inherit crane ;
29
+ inherit crane fenix ;
25
30
} ;
26
31
in {
27
32
default = craneDerivations . myCrate ;
Original file line number Diff line number Diff line change 2
2
pkgs ,
3
3
system ,
4
4
crane ,
5
+ fenix ,
5
6
} : let
6
- craneLib = crane . lib . ${ system } ;
7
+ fenix-channel = fenix . packages . ${ system } . latest ;
8
+ fenix-toolchain = fenix-channel . withComponents [
9
+ "cargo"
10
+ "clippy"
11
+ "rust-analyzer"
12
+ "rust-src"
13
+ "rustc"
14
+ "rustfmt"
15
+ ] ;
16
+
17
+ craneLib = crane . lib . ${ system } . overrideToolchain fenix-toolchain ;
7
18
8
19
# Common derivation arguments used for all builds
9
20
commonArgs = {
10
21
src = craneLib . cleanCargoSource ../. ;
11
22
12
23
nativeBuildInputs = pkgs . lib . optionals pkgs . stdenv . isDarwin [
24
+ pkgs . darwin . apple_sdk . frameworks . Security
25
+ pkgs . darwin . apple_sdk . frameworks . SystemConfiguration
13
26
pkgs . libiconv
14
27
] ;
15
28
} ;
51
64
myCrate
52
65
myCrateClippy
53
66
myCrateCoverage
67
+ fenix-toolchain
54
68
;
55
69
}
Original file line number Diff line number Diff line change 5
5
url = "github:ipetkov/crane" ;
6
6
inputs . nixpkgs . follows = "nixpkgs" ;
7
7
} ;
8
+ fenix = {
9
+ url = "github:nix-community/fenix" ;
10
+ inputs . nixpkgs . follows = "nixpkgs" ;
11
+ } ;
8
12
pre-commit-hooks = {
9
13
url = "github:cachix/pre-commit-hooks.nix" ;
10
14
inputs . nixpkgs . follows = "nixpkgs" ;
15
19
self ,
16
20
nixpkgs ,
17
21
crane ,
22
+ fenix ,
18
23
pre-commit-hooks ,
19
24
} : let
20
25
forEachSystem = nixpkgs . lib . genAttrs [
25
30
] ;
26
31
in {
27
32
checks = forEachSystem ( system : let
28
- craneDerivations = nixpkgs . legacyPackages . ${ system } . callPackage ./default.nix { inherit crane ; } ;
33
+ pkgs = import nixpkgs { inherit system ; } ;
34
+ craneDerivations = pkgs . callPackage ./default.nix { inherit crane fenix ; } ;
29
35
pre-commit-check = pre-commit-hooks . lib . ${ system } . run {
30
36
src = ../. ;
31
37
hooks = {
46
52
} ) ;
47
53
48
54
devShells = forEachSystem ( system : let
49
- pkgs = nixpkgs . legacyPackages . ${ system } ;
50
- craneDerivations = pkgs . callPackage ./default.nix { inherit crane ; } ;
55
+ pkgs = import nixpkgs { inherit system ; } ;
56
+ craneDerivations = pkgs . callPackage ./default.nix { inherit crane fenix ; } ;
51
57
in {
52
58
default = pkgs . mkShell {
53
- nativeBuildInputs = with pkgs ;
59
+ packages = with pkgs ;
54
60
[
55
- cargo
56
- clippy
57
- rust-analyzer
58
- rustc
59
- rustfmt
61
+ craneDerivations . fenix-toolchain
60
62
]
61
63
++ craneDerivations . commonArgs . nativeBuildInputs ;
62
64
You can’t perform that action at this time.
0 commit comments