From 18ebfb9d9fae737b1a6ce8c5673720767854c407 Mon Sep 17 00:00:00 2001 From: Colin Date: Wed, 3 May 2023 08:16:46 +0000 Subject: [PATCH] fix feedsearch-crawler to build outside of overlay --- integrations/nur/default.nix | 12 ++++++++++++ pkgs/default.nix | 10 ++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/integrations/nur/default.nix b/integrations/nur/default.nix index 737f6a0e..d969af89 100644 --- a/integrations/nur/default.nix +++ b/integrations/nur/default.nix @@ -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: +# 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 {} }: let diff --git a/pkgs/default.nix b/pkgs/default.nix index cc5efdb7..18e8a939 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,5 +1,9 @@ { pkgs ? import {}, 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