1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";

  outputs = { self, nixpkgs, ... }:
    let
      forAllSystems = nixpkgs.lib.genAttrs [ "aarch64-darwin" "x86_64-linux" ];
    in
    {
      devShells = forAllSystems (system:
        let
          pkgs = nixpkgs.legacyPackages.${system};
        in
        {
          default = pkgs.mkShell {
            packages = [
              pkgs.cargo
              pkgs.rustc
              pkgs.clippy
              pkgs.rustfmt
              pkgs.rust-analyzer
              # bin/coverage.
              pkgs.grcov
              pkgs.jq
              pkgs.bc
              pkgs.just
              # The parity suite is Ruby (minitest ships with ruby 3.4's bundled gems).
              pkgs.ruby
              pkgs.jujutsu
            ];

            # There is no rustup llvm-tools component here, so bin/coverage
            # points grcov at the LLVM that rustc was built with.
            GRCOV_LLVM_PATH = "${pkgs.rustc.llvmPackages.llvm}/bin";

            RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}";
          };
        });
    };
}