From 25dc12aab139b4bd3438c764a1d479ae8517a81a Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 26 Jun 2024 03:58:47 +0200 Subject: [PATCH] components.nix: Extract dependency scope This avoids polluting nixComponents with things that aren't our components. Fixes the extraction of passthru tests, which failed for boehmgc which had many irrelevant ones anyway. --- flake.nix | 12 +++++++++++- packaging/components.nix | 6 ------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/flake.nix b/flake.nix index d49bccda8..870b82950 100644 --- a/flake.nix +++ b/flake.nix @@ -176,11 +176,21 @@ # without "polluting" the top level "`pkgs`" attrset. # This also has the benefit of providing us with a distinct set of packages # we can iterate over. - nixComponents = lib.makeScope final.newScope (import ./packaging/components.nix { + nixComponents = lib.makeScope final.nixDependencies.newScope (import ./packaging/components.nix { pkgs = final; inherit stdenv versionSuffix; }); + # The dependencies are in their own scope, so that they don't have to be + # in Nixpkgs top level `pkgs` or `nixComponents`. + nixDependencies = lib.makeScope final.newScope (scope: { + inherit stdenv versionSuffix; + libseccomp = final.libseccomp_nix; + boehmgc = final.boehmgc_nix; + libgit2 = final.libgit2_nix; + busybox-sandbox-shell = final.busybox-sandbox-shell or final.default-busybox-sandbox-shell; + }); + nix = final.nixComponents.nix; nix-internal-api-docs = final.callPackage ./src/internal-api-docs/package.nix { diff --git a/packaging/components.nix b/packaging/components.nix index 2d06cfec4..e1e73d4c0 100644 --- a/packaging/components.nix +++ b/packaging/components.nix @@ -5,12 +5,6 @@ in # This becomes the pkgs.nixComponents attribute set { - inherit stdenv versionSuffix; - libseccomp = pkgs.libseccomp_nix; - boehmgc = pkgs.boehmgc_nix; - libgit2 = pkgs.libgit2_nix; - busybox-sandbox-shell = pkgs.busybox-sandbox-shell or pkgs.default-busybox-sandbox-shell; - nix = callPackage ../package.nix { }; nix-util = callPackage ../src/libutil/package.nix { };