Skip to content

Commit c4e68a9

Browse files
authored
Merge pull request #57 from DeterminateSystems/relax-overlay-check
Don't try to call the overlay function
2 parents 030f2d0 + baccc4e commit c4e68a9

3 files changed

Lines changed: 29 additions & 2 deletions

File tree

flake.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,9 @@
258258
# flake here. Maybe this schema should be moved to the
259259
# nixpkgs flake, where it does have access.
260260
if !builtins.isFunction overlay then
261-
throw "overlay is not a function, but a set instead"
261+
throw "Overlay is not a function. It should be structured like: `final: previous: { /* ... */ }`."
262262
else
263-
builtins.isAttrs (overlay { } { });
263+
true;
264264
}) output
265265
);
266266
};

tests/overlays.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"inventory": {
3+
"overlays": {
4+
"doc": "The `overlays` flake output defines [\"overlays\"](https://nixos.org/manual/nixpkgs/stable/#chap-overlays) that can be plugged into Nixpkgs.\nOverlays add additional packages or modify or replace existing packages.\n",
5+
"output": {
6+
"children": {
7+
"example": {
8+
"what": "Nixpkgs overlay"
9+
}
10+
}
11+
}
12+
}
13+
},
14+
"version": 2
15+
}

tests/overlays/flake.nix

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
outputs =
3+
{ ... }:
4+
{
5+
overlays.example =
6+
final:
7+
{ foo, ... }:
8+
{
9+
inherit foo;
10+
};
11+
};
12+
}

0 commit comments

Comments
 (0)