Skip to content

Commit 5d26747

Browse files
committed
wip laziness
1 parent 92dd2f8 commit 5d26747

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

maintainers/types/example.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ in
7878
};
7979
tests = mkOption {
8080
description = "at least one test for the example";
81-
type = with types; attrsOf test;
81+
type = with types; lazyAttrsOf test;
8282
default = { };
8383
};
8484
links = mkOption {

maintainers/types/module.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ in
125125
'';
126126
};
127127
examples = mkOption {
128-
type = with types; attrsOf example;
128+
type = with types; lazyAttrsOf example;
129129
description = ''
130130
Configurations that illustrate how to set up the ${type}.
131131

maintainers/types/project.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ in
132132
we can still reduce granularity and move all examples to the application level.
133133
*/
134134
examples = mkOption {
135-
type = attrsOf example;
135+
type = lazyAttrsOf example;
136136
description = "A configuration of an existing application module that illustrates how to use it";
137137
default = { };
138138
};
@@ -141,7 +141,7 @@ in
141141
# Without this field, many applications will appear entirely untested although there's actually *some* assurance that *something* works.
142142
# Eventually we want to move to documentable tests exclusively, and then remove this field, but this may take a very long time.
143143
tests = mkOption {
144-
type = attrsOf test;
144+
type = lazyAttrsOf test;
145145
default = { };
146146
description = "NixOS test that ensures project components behave as intended";
147147
};

maintainers/types/test.nix

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ let
100100
else if test ? meta.broken && test.meta.broken then
101101
null
102102
else
103-
pkgs.testers.runNixOSTest args;
103+
lib.lazyDerivation { derivation = pkgs.testers.runNixOSTest args; };
104104

105105
callTest =
106106
module:
@@ -128,7 +128,9 @@ in
128128
# This is because test nodes are eagerly evaluated to create the
129129
# driver's `vmStartScripts` (see `nixos/lib/testing/driver.nix` in
130130
# NixOS).
131-
type = with types; nullOr (coercedTo (either deferredModule package) callTest (nullOr package));
131+
type =
132+
with types;
133+
nullOr (coercedTo (either deferredModule package) callTest (nullOr deferredModule));
132134
default = null;
133135
description = "NixOS test module";
134136
};

0 commit comments

Comments
 (0)