diff options
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 29 |
1 files changed, 4 insertions, 25 deletions
@@ -3,11 +3,6 @@ | |||
3 | 3 | ||
4 | nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; | 4 | nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; |
5 | 5 | ||
6 | fenix = { | ||
7 | url = "github:nix-community/fenix"; | ||
8 | inputs.nixpkgs.follows = "nixpkgs"; | ||
9 | }; | ||
10 | |||
11 | gitignore = { | 6 | gitignore = { |
12 | url = "github:hercules-ci/gitignore.nix"; | 7 | url = "github:hercules-ci/gitignore.nix"; |
13 | inputs.nixpkgs.follows = "nixpkgs"; | 8 | inputs.nixpkgs.follows = "nixpkgs"; |
@@ -18,7 +13,6 @@ | |||
18 | outputs = | 13 | outputs = |
19 | { self | 14 | { self |
20 | , nixpkgs | 15 | , nixpkgs |
21 | , fenix | ||
22 | , gitignore | 16 | , gitignore |
23 | }: | 17 | }: |
24 | let | 18 | let |
@@ -29,37 +23,22 @@ | |||
29 | nixpkgsFor = forAllSystems (system: | 23 | nixpkgsFor = forAllSystems (system: |
30 | import nixpkgs { inherit system; }); | 24 | import nixpkgs { inherit system; }); |
31 | 25 | ||
32 | chanspec = { | ||
33 | date = "2022-09-01"; | ||
34 | channel = "nightly"; | ||
35 | sha256 = "tS2IHsewoaEMHn9x8DfcEJefShcW85iDrfBWXOZJa9c="; # set zeros after modifying channel or date | ||
36 | }; | ||
37 | rustChannel = p: (fenix.overlay p p).fenix.toolchainOf chanspec; | ||
38 | |||
39 | in | 26 | in |
40 | { | 27 | { |
41 | 28 | ||
42 | |||
43 | devShell = forAllSystems (system: | 29 | devShell = forAllSystems (system: |
44 | let | 30 | let |
45 | pkgs = nixpkgsFor."${system}"; | 31 | pkgs = nixpkgsFor."${system}"; |
46 | toolchain = (rustChannel pkgs).withComponents [ | ||
47 | "rustc" | ||
48 | "cargo" | ||
49 | "rust-std" | ||
50 | "rustfmt" | ||
51 | "clippy" | ||
52 | "rust-src" | ||
53 | ]; | ||
54 | inherit (fenix.packages."${system}") rust-analyzer; | ||
55 | in | 32 | in |
56 | pkgs.mkShell { | 33 | pkgs.mkShell { |
57 | nativeBuildInputs = [ | 34 | nativeBuildInputs = [ |
58 | pkgs.cargo-watch | 35 | pkgs.cargo-watch |
59 | pkgs.bacon | 36 | pkgs.bacon |
60 | pkgs.cargo-insta | 37 | pkgs.cargo-insta |
61 | rust-analyzer | 38 | pkgs.rust-analyzer |
62 | toolchain | 39 | pkgs.rustc |
40 | pkgs.rustfmt | ||
41 | pkgs.cargo | ||
63 | ]; | 42 | ]; |
64 | RUST_LOG = "info"; | 43 | RUST_LOG = "info"; |
65 | RUST_BACKTRACE = 1; | 44 | RUST_BACKTRACE = 1; |