Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to handle the new schema format #72

Merged
merged 4 commits into from
Aug 30, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions src/mixed-flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@

mkChildren = children: { inherit children; };

mkLeaf = leaf: { inherit leaf; };

in

rec {

allSchemas = (flake.outputs.schemas or defaultSchemas) // schemaOverrides;

# FIXME: make this configurable
defaultSchemas = (builtins.getFlake "https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.0.6+rev-8b320d78bfbc47515f3366b43e1a29c69519f36a/0189d657-3901-716b-9cde-7ec5aacc7cf8/source.tar.gz?narHash=sha256-3H1AXsE4SRqT1tZDb2gxdSwf3JInOgS1F8nq2QsXmHg=").schemas;
defaultSchemas = (builtins.getFlake "github:DeterminateSystems/flake-schemas/25fcca8e8baa402de593a3854fcc50581f4e912a").schemas;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to swap to a flakehub URL before merging.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't do that right now because we can't publish an updated flake-schemas : https://github.com/DeterminateSystems/flake-schemas/actions/runs/6023875150/job/16341456708

So we should merge this, publish a new version, and then update the URL.


# Ignore legacyPackages for now, since it's very big and throws uncatchable errors.
schemaOverrides.legacyPackages = {
Expand Down Expand Up @@ -65,15 +63,13 @@
if attrs ? children
then
mkChildren (builtins.mapAttrs (childName: child: doFilter child) attrs.children)
else if attrs ? leaf then
mkLeaf
{
forSystems = attrs.leaf.forSystems or null;
doc = if attrs.leaf ? doc then attrs.leaf.doc else null;
#evalChecks = attrs.leaf.evalChecks or {};
}
else
throw "Schema returned invalid tree node."
{
forSystems = attrs.forSystems or null;
shortDescription = attrs.shortDescription or null;
what = attrs.what or null;
#evalChecks = attrs.evalChecks or {};
}
else
{ };
in
Expand Down
Loading