1
0
Fork 0
mirror of https://github.com/hercules-ci/flake-parts.git synced 2024-12-14 11:47:31 +00:00

Merge pull request #98 from hercules-ci/easyOverlay-support-simplistic-fake-pkgs

`easyOverlay`: support simplistic fake pkgs
This commit is contained in:
Robert Hensing 2023-01-04 20:23:07 +01:00 committed by GitHub
commit c089237966
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View file

@ -17,13 +17,13 @@ rec {
};
empty = mkFlake
{ self = { }; }
{ inputs.self = { }; }
{
systems = [ ];
};
example1 = mkFlake
{ self = { }; }
{ inputs.self = { }; }
{
systems = [ "a" "b" ];
perSystem = { system, ... }: {
@ -32,7 +32,7 @@ rec {
};
easyOverlay = mkFlake
{ self = { }; }
{ inputs.self = { }; }
{
imports = [ flake-parts.flakeModules.easyOverlay ];
systems = [ "a" ];

View file

@ -44,7 +44,12 @@ in
config = {
flake.overlays.default = final: prev:
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 {
modules = [
{