flake: optimize nixpkgs importing
`nixpkgs.legacyPackages.${system}` allows reusing a single pkgs instance
that is shared among all flakes with the same `nixpkgs` input.
This is relevant when a user overrides the `nixpkgs` input of our flake
or exports our `nixpkgs` input to other flakes.
`import nixpkgs` would create a new pkgs instance instead.
This commit is contained in:
@@ -18,8 +18,8 @@
|
||||
lib = {
|
||||
mkNbPkgs = {
|
||||
system
|
||||
, pkgs ? import nixpkgs { inherit system; }
|
||||
, pkgsUnstable ? import nixpkgsUnstable { inherit system; }
|
||||
, pkgs ? nixpkgs.legacyPackages.${system}
|
||||
, pkgsUnstable ? nixpkgsUnstable.legacyPackages.${system}
|
||||
}:
|
||||
import ./pkgs { inherit pkgs pkgsUnstable; };
|
||||
};
|
||||
@@ -65,7 +65,7 @@
|
||||
|
||||
} // (flake-utils.lib.eachSystem supportedSystems (system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
|
||||
nbPkgs = self.lib.mkNbPkgs { inherit system pkgs; };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user