Skip to content

Commit d72b25e

Browse files
eljammfricklerhandwerk
authored andcommitted
overview: compare output between typing system
1 parent 68d96bd commit d72b25e

2 files changed

Lines changed: 54 additions & 14 deletions

File tree

default.nix

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,27 @@ rec {
163163
};
164164
};
165165

166+
projects = make-projects raw-projects;
167+
168+
# TODO: remove after migrating to modules
169+
# ===
170+
171+
raw-projects-new = import ./projects/default-module.nix {
172+
inherit lib;
173+
pkgs = pkgs // ngipkgs;
174+
sources = {
175+
inputs = sources;
176+
modules = nixos-modules;
177+
inherit examples;
178+
};
179+
};
180+
181+
# TODO: delete the file after migrating to modules
182+
projects-new = make-projects raw-projects-new.config.projects;
183+
184+
# TODO:
185+
# ===
186+
166187
project-models = import ./projects/models.nix { inherit lib pkgs sources; };
167188

168189
# we mainly care about the types being checked
@@ -176,7 +197,8 @@ rec {
176197
pkgs.writeText "dummy" (lib.strings.toJSON project-metadata);
177198

178199
# TODO: find a better place for this
179-
projects =
200+
make-projects =
201+
projects:
180202
with lib;
181203
let
182204
nixosTest =
@@ -243,7 +265,7 @@ rec {
243265
) ((empty-if-null project.nixos.tests or { }) // (filter-map (nixos.examples or { }) "tests"));
244266
};
245267
in
246-
mapAttrs (name: project: hydrate project) raw-projects;
268+
mapAttrs (name: project: hydrate project) projects;
247269

248270
shell = pkgs.mkShellNoCC {
249271
packages = [

flake.nix

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,36 @@
7979
in
8080
rec {
8181
packages = ngipkgs // {
82-
overview = import ./overview {
83-
inherit
84-
lib
85-
lib'
86-
self
87-
nixpkgs
88-
system
89-
;
90-
pkgs = pkgs // ngipkgs;
91-
projects = ngiProjects;
92-
options = optionsDoc.optionsNix;
93-
};
82+
overview =
83+
let
84+
overview-new = import ./overview {
85+
inherit
86+
lib
87+
lib'
88+
self
89+
nixpkgs
90+
system
91+
;
92+
pkgs = pkgs // ngipkgs;
93+
projects = classic.projects-new;
94+
options = optionsDoc.optionsNix;
95+
};
96+
overview-old = import ./overview {
97+
inherit
98+
lib
99+
lib'
100+
self
101+
nixpkgs
102+
system
103+
;
104+
pkgs = pkgs // ngipkgs;
105+
projects = ngiProjects;
106+
options = optionsDoc.optionsNix;
107+
};
108+
in
109+
# TODO: switch to overview-new
110+
assert overview-old == overview-new;
111+
overview-old;
94112

95113
options =
96114
pkgs.runCommand "options.json"

0 commit comments

Comments
 (0)