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:
parent
16e2d4c8b7
commit
6f8b4d9ebe
@ -18,8 +18,8 @@
|
|||||||
lib = {
|
lib = {
|
||||||
mkNbPkgs = {
|
mkNbPkgs = {
|
||||||
system
|
system
|
||||||
, pkgs ? import nixpkgs { inherit system; }
|
, pkgs ? nixpkgs.legacyPackages.${system}
|
||||||
, pkgsUnstable ? import nixpkgsUnstable { inherit system; }
|
, pkgsUnstable ? nixpkgsUnstable.legacyPackages.${system}
|
||||||
}:
|
}:
|
||||||
import ./pkgs { inherit pkgs pkgsUnstable; };
|
import ./pkgs { inherit pkgs pkgsUnstable; };
|
||||||
};
|
};
|
||||||
@ -65,7 +65,7 @@
|
|||||||
|
|
||||||
} // (flake-utils.lib.eachSystem supportedSystems (system:
|
} // (flake-utils.lib.eachSystem supportedSystems (system:
|
||||||
let
|
let
|
||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
|
||||||
nbPkgs = self.lib.mkNbPkgs { inherit system pkgs; };
|
nbPkgs = self.lib.mkNbPkgs { inherit system pkgs; };
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user