1
0
Fork 0
mirror of https://github.com/hercules-ci/flake-parts.git synced 2024-12-15 17:50:53 +00:00

easyOverlay: Support pkgs.system as a fallback

This is required for `exportOverlays` in `digga`, which passes a fake
`pkgs` that doesn't have a `pkgs.stdenv`, but does have a `pkgs.system`.
This commit is contained in:
Robert Hensing 2023-01-04 20:10:09 +01:00
parent 836c38aa2a
commit 30bddfe65b

View file

@ -44,7 +44,12 @@ in
config = { config = {
flake.overlays.default = final: prev: flake.overlays.default = final: prev:
let let
system = prev.stdenv.hostPlatform.system; system =
prev.stdenv.hostPlatform.system or (
prev.system or (
throw "Could not determine the `hostPlatform` of Nixpkgs. Was this overlay loaded as a Nixpkgs overlay, or was it loaded into something else?"
)
);
perSys = (getSystem system).extendModules { perSys = (getSystem system).extendModules {
modules = [ modules = [
{ {