fix feedsearch-crawler to build outside of overlay

This commit is contained in:
Colin 2023-05-03 08:16:46 +00:00
parent a8584cf8dc
commit 18ebfb9d9f
2 changed files with 20 additions and 2 deletions

View File

@ -10,6 +10,18 @@
#
# to manually query available packages, modules, etc, try:
# - nix eval --impure --expr 'builtins.attrNames (import ./. {})'
#
# to validate this before a push that would propagate to NUR:
# NIX_PATH= NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-env -f . -qa \* --meta --xml \
# --allowed-uris https://static.rust-lang.org \
# --option restrict-eval true \
# --option allow-import-from-derivation true \
# --drv-path --show-trace \
# -I nixpkgs=$(nix-instantiate --find-file nixpkgs) \
# -I ../../
# ^ source: <https://github.com/nix-community/nur-packages-template/blob/master/.github/workflows/build.yml#L63>
# N.B.: nur eval allows only PATH (inherited) and NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM="1" (forced),
# hence the erasing of NIX_PATH above (to remove external overlays)
{ pkgs ? import <nixpkgs> {} }:
let

View File

@ -1,5 +1,9 @@
{ pkgs ? import <nixpkgs> {}, lib ? pkgs.lib, unpatched ? pkgs }:
let
pythonPackagesOverlay = py-final: py-prev: import ./python-packages {
inherit (py-final) callPackage;
};
# this scope ensures that my packages can all take each other as inputs,
# even when evaluated bare (i.e. outside of an overlay)
sane = lib.makeScope pkgs.newScope (self: with self; {
@ -58,10 +62,12 @@ let
### PYTHON PACKAGES
pythonPackagesExtensions = (unpatched.pythonPackagesExtensions or []) ++ [
(py-final: py-prev: import ./python-packages { inherit (py-final) callPackage; })
pythonPackagesOverlay
];
# when this scope's applied as an overlay pythonPackagesExtensions is propagated as desired.
# but when freestanding (e.g. NUR), it never gets plumbed into the outer pkgs, so we have to do that explicitly.
pythonInterpreters = unpatched.pythonInterpreters.override { inherit pythonPackagesExtensions; };
python3 = unpatched.python3.override {
packageOverrides = pythonPackagesOverlay;
};
});
in sane.packages sane