pkgs/default.nix: simplify (no need for the scope)

This commit is contained in:
Colin 2023-05-17 23:17:24 +00:00
parent 2db988b67c
commit 85c8292f9a
2 changed files with 16 additions and 9 deletions

View File

@ -3,6 +3,5 @@
# - `additional` packages # - `additional` packages
# - `patched` versions of nixpkgs (which necessarily shadow their nixpkgs version) # - `patched` versions of nixpkgs (which necessarily shadow their nixpkgs version)
# - `pythonPackagesExtensions` # - `pythonPackagesExtensions`
import ../pkgs import ../pkgs { pkgs = prev; final = next; }
{ pkgs = next; lib = prev.lib; unpatched = prev; }
) )

View File

@ -1,14 +1,22 @@
{ pkgs ? import <nixpkgs> {}, lib ? pkgs.lib, unpatched ? pkgs }: # this supports being used as an overlay or in a standalone context
# - if overlay, invoke as `(final: prev: import ./. { inherit final; pkgs = prev; })`
# - if standalone: `import ./. { inherit pkgs; }`
#
# using the correct invocation is critical if any packages mentioned here are
# additionally patched elsewhere
#
{ pkgs ? import <nixpkgs> {}, final ? null }:
let let
lib = pkgs.lib;
unpatched = pkgs;
pythonPackagesOverlay = py-final: py-prev: import ./python-packages { pythonPackagesOverlay = py-final: py-prev: import ./python-packages {
inherit (py-final) callPackage; inherit (py-final) callPackage;
}; };
# this scope ensures that my packages can all take each other as inputs, final' = if final != null then final else (pkgs // sane);
# even when evaluated bare (i.e. outside of an overlay) sane = with final'; {
sane = lib.makeScope pkgs.newScope (self: with self; {
sane-data = import ../modules/data { inherit lib; }; sane-data = import ../modules/data { inherit lib; };
sane-lib = import ../modules/lib pkgs; sane-lib = import ../modules/lib final';
### ADDITIONAL PACKAGES ### ADDITIONAL PACKAGES
bootpart-uefi-x86_64 = callPackage ./additional/bootpart-uefi-x86_64 { }; bootpart-uefi-x86_64 = callPackage ./additional/bootpart-uefi-x86_64 { };
@ -80,5 +88,5 @@ let
python3 = unpatched.python3.override { python3 = unpatched.python3.override {
packageOverrides = pythonPackagesOverlay; packageOverrides = pythonPackagesOverlay;
}; };
}); };
in sane.packages sane in sane