Skip to content

Commit

Permalink
filter out null artifacts from project overview
Browse files Browse the repository at this point in the history
  • Loading branch information
fricklerhandwerk committed Nov 17, 2024
1 parent dbf68d6 commit fde6800
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions projects/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,21 @@
in
concatMapAttrs names (readDir baseDirectory);

hydrate = project: {
packages = project.packages or {};
nixos.modules = project.nixos.modules or {};
nixos.examples = project.nixos.examples or {};
nixos.tests = project.nixos.tests or {};
};
hydrate = let
empty-if-null = x:
if x != null
then x
else {};
in
# we use fields to track state of completion.
# - `null` means "expected but missing"
# - not set means "not applicable"
project: {
packages = empty-if-null (project.packages or {});
nixos.modules = empty-if-null (project.nixos.modules or {});
nixos.examples = empty-if-null (project.nixos.examples or {});
nixos.tests = empty-if-null (project.nixos.tests or {});
};
in
mapAttrs
(
Expand Down

0 comments on commit fde6800

Please sign in to comment.