From dec78edbbebe68831b1857d240d94ebdb4ddecae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 2 Jan 2024 12:00:30 +0100 Subject: [PATCH] always use the buildEnv The purpose of this `env` is to add the binaries to the `PATH`. The benefit of making it purer is that unwrapped programs missing dependencies may fail. As a added benefit this dramatically reduces the collision warnings from `buildEnv` --- nixpkgs_review/nix/review-shell.nix | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/nixpkgs_review/nix/review-shell.nix b/nixpkgs_review/nix/review-shell.nix index 9938f13..3d0bba3 100644 --- a/nixpkgs_review/nix/review-shell.nix +++ b/nixpkgs_review/nix/review-shell.nix @@ -3,21 +3,18 @@ , attrs-path # Path to Nix file containing a list of attributes to build , nixpkgs-path # Path to this review's nixpkgs , pkgs ? import nixpkgs-path { inherit system; config = import nixpkgs-config-path; } -, lib ? pkgs.lib }: -let - attrs = import attrs-path pkgs; - env = pkgs.buildEnv { - name = "env"; - paths = attrs; - ignoreCollisions = true; - }; -in (import nixpkgs-path { }).mkShell { name = "review-shell"; preferLocalBuild = true; allowSubstitutes = false; dontWrapQtApps = true; - packages = if builtins.length attrs > 50 then [ env ] else attrs; + + packages = pkgs.buildEnv { + name = "env"; + paths = import attrs-path pkgs; + pathsToLink = [ "/bin" ]; + ignoreCollisions = true; + }; }