Skip to content

Commit

Permalink
components.nix: Extract dependency scope
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
roberth committed Jun 26, 2024
1 parent bfd692b commit f1f9f7c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
12 changes: 11 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 0 additions & 6 deletions packaging/components.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { };
Expand Down

0 comments on commit f1f9f7c

Please sign in to comment.