Open
Description
Expected Behavior
-
Do not load the overlays of all inputs. Not appropriate for a framework, as it's O(n), and makes a single overlay strict in all overlays.
-
Do not fail if loading an overlay of an input.
Current Behavior
See
Steps to Reproduce
git clone https://github.com/sweenu/nixfiles
cd nixfiles
git checkout 41c881c76fc89f44cbefaf0da430c49c4153933c
nix repl --debugger
# ignore the warning about flake-parts args, that's been fixed
nix-repl> :lf .
nix-repl> overlays
error: attribute 'stdenv' missing
nix-repl> prev
{ callPackage = «lambda @ /nix/store/233086pcwz4qx09l1xgdlzn2yh1p04zy-source/lib/exportOverlays.nix:61:23»; isFakePkgs = true; lib = { ... }; system = "fake-system"; }
Additional Context
pkgs.stdenv.hostPlatform.system
is the recommended way to get a system
from a pkgs
. There's been talk of deprecating pkgs.system
, and Nixpkgs has in large part migrated.
You might want to do something like fakePkgs = mapAttrs (k: v: throw "exportOverlays: not allowing access to the real Nixpkgs for X reason, when the overlay tried to access
${k}") realPkgs
to improve the UX a tiny bit. Might break if pkgs?foo then seq pkgs.foo bar
type of logic though.
Your Environment
[user@system:~]$ nix run nixpkgs#nix-info -- -m; nix flake metadata
output here
Nix 2.13.0pre20230103_1534133.