From 836c38aa2ac676f867c201c6b35c00bb8292bd1a Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 4 Jan 2023 20:09:46 +0100 Subject: [PATCH 1/2] eval-tests: Fix warnings --- dev/tests/eval-tests.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/tests/eval-tests.nix b/dev/tests/eval-tests.nix index 44b20f3..c0e5d64 100644 --- a/dev/tests/eval-tests.nix +++ b/dev/tests/eval-tests.nix @@ -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" ]; From 30bddfe65b9f19d12730d6e77e8dd94fafd41b72 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 4 Jan 2023 20:10:09 +0100 Subject: [PATCH 2/2] 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`. --- extras/easyOverlay.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/extras/easyOverlay.nix b/extras/easyOverlay.nix index 306836a..fbb1b03 100644 --- a/extras/easyOverlay.nix +++ b/extras/easyOverlay.nix @@ -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 = [ {