Skip to content

Commit

Permalink
Improvements to the Nix shell. (#282)
Browse files Browse the repository at this point in the history
### What

1. Remove the `inputsFrom` clause, because we want to be able to use the
Nix shell to develop even when the binary is not currently building.
2. Split runtime inputs out into `buildInputs`.
3. Split large performance-testing tools out into a separate shell,
called "perf".
4. Add OpenSSL as an explicit dependency.
  • Loading branch information
SamirTalwar authored Feb 6, 2024
1 parent ac16877 commit 029c1e7
Showing 1 changed file with 37 additions and 21 deletions.
58 changes: 37 additions & 21 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -83,37 +83,53 @@
formatter = pkgs.nixpkgs-fmt;

devShells.default = pkgs.mkShell {
inputsFrom = builtins.attrValues self.checks.${localSystem};
# build-time inputs
nativeBuildInputs = [
# runtime
pkgs.protobuf
# Development
pkgs.just
pkgs.nixpkgs-fmt
pkgs.nodePackages.prettier
pkgs.pkg-config

# development
# Rust
pkgs.cargo-edit
pkgs.cargo-expand
pkgs.cargo-flamegraph
pkgs.cargo-insta
pkgs.cargo-machete
pkgs.cargo-nextest
pkgs.cargo-watch
pkgs.just
pkgs.k6
pkgs.nixpkgs-fmt
pkgs.nodePackages.prettier
pkgs.pkg-config
pkgs.rnix-lsp
pkgs.skopeo
rust.rustToolchain
] ++ (
pkgs.lib.optionals
pkgs.stdenv.isLinux
[
pkgs.heaptrack
pkgs.linuxPackages_latest.perf
pkgs.mold-wrapped
pkgs.valgrind
]
);

# Benchmarks
pkgs.k6

# Deployment
pkgs.skopeo
];

# runtime inputs
buildInputs = [
pkgs.openssl
pkgs.protobuf
];
};

# This performance-testing shell will only work on Linux.
devShells.perf = pkgs.mkShell {
inputsFrom = [
self.devShells.${localSystem}.default
];

# build-time inputs
nativeBuildInputs = [
pkgs.heaptrack
pkgs.linuxPackages_latest.perf
pkgs.mold-wrapped
pkgs.valgrind
];
};
});
}
);
}

0 comments on commit 029c1e7

Please sign in to comment.