Skip to content

Commit

Permalink
pkgs/by-name: make callPackage intrinsic
Browse files Browse the repository at this point in the history
  • Loading branch information
wegank authored and fricklerhandwerk committed Jun 5, 2024
1 parent 5cf0253 commit 98203d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
12 changes: 3 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,11 @@
// args);

# NGI packages are imported from ./pkgs/by-name/default.nix.
importNgiPackages = pkgs: let
callPackage = pkgs.newScope (
ngiPackages // {inherit callPackage;}
);

ngiPackages = import ./pkgs/by-name {
importNgiPackages = pkgs:
import ./pkgs/by-name {
inherit (pkgs) lib;
inherit callPackage dream2nix pkgs;
inherit dream2nix pkgs;
};
in
ngiPackages;

# NGI projects are imported from ./projects/default.nix.
# Each project includes packages, and optionally, modules, configurations and tests.
Expand Down
7 changes: 5 additions & 2 deletions pkgs/by-name/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
lib,
callPackage,
dream2nix,
pkgs,
}: let
Expand Down Expand Up @@ -28,7 +27,7 @@
callModule = module: let
evaluated = lib.evalModules {
specialArgs = {
inherit dream2nix;
dream2nix = import dream2nix;
packageSets.nixpkgs = pkgs;
};
modules = [
Expand All @@ -44,6 +43,10 @@
in
evaluated.config.public;

callPackage = pkgs.newScope (
self // {inherit callPackage;}
);

self =
mapAttrs (
_: directory:
Expand Down

0 comments on commit 98203d7

Please sign in to comment.