Skip to content

Commit

Permalink
nix: Use packages instead of buildInputs
Browse files Browse the repository at this point in the history
In practice, `packages` sets the value for `nativeBuildInputs`. This has the following advantages:

- `buildInputs` is for runtime dependencies. `nativeBuildInputs` is for
  build dependencies (this usually not an issue unless cross compiling)
- `shellHook`s will actually run, allowing packages to safely append to
  variables like `XDG_DATA_DIRS`
- It's more idiomatic and how it's recommended to be used in the docs
  • Loading branch information
JoaquinTrinanes authored and thoughtpolice committed Nov 3, 2024
1 parent a20f386 commit 49a0c0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
});

devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
packages = with pkgs; [
# NOTE (aseipp): explicitly add rust-src to the rustc compiler only in
# devShell. this in turn causes a dependency on the rust compiler src,
# which bloats the closure size by several GiB. but doing this here
Expand Down

0 comments on commit 49a0c0c

Please sign in to comment.