From 49a0c0c802b6b23ee2136bfed46dcebf12b7b0e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Tri=C3=B1anes?= Date: Fri, 1 Nov 2024 23:17:29 +0100 Subject: [PATCH] nix: Use packages instead of buildInputs 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 --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index cf2037346c..110eb81bd6 100644 --- a/flake.nix +++ b/flake.nix @@ -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