{"id":27958435,"url":"https://github.com/determinatesystems/inspect","last_synced_at":"2025-05-07T18:23:56.009Z","repository":{"id":245443228,"uuid":"818254957","full_name":"DeterminateSystems/inspect","owner":"DeterminateSystems","description":"Inspect a flake's outputs with flake schemas.","archived":false,"fork":false,"pushed_at":"2024-07-24T20:20:11.000Z","size":43,"stargazers_count":6,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-26T17:44:46.889Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DeterminateSystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-21T12:41:26.000Z","updated_at":"2024-10-02T19:17:46.000Z","dependencies_parsed_at":"2024-06-22T05:47:09.347Z","dependency_job_id":"58f82abd-c206-4bc7-8841-186b4bed97a9","html_url":"https://github.com/DeterminateSystems/inspect","commit_stats":null,"previous_names":["determinatesystems/inspect"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeterminateSystems%2Finspect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeterminateSystems%2Finspect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeterminateSystems%2Finspect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeterminateSystems%2Finspect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DeterminateSystems","download_url":"https://codeload.github.com/DeterminateSystems/inspect/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252932385,"owners_count":21827289,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-07T18:23:55.375Z","updated_at":"2025-05-07T18:23:55.997Z","avatar_url":"https://github.com/DeterminateSystems.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Inspect a flake's outputs using flake schemas\n\nFrom the Determinate Systems blog post about [flake schemas](https://determinate.systems/posts/flake-schemas/):\n\n\u003e While there are a number of “well-known” flake output types that are recognized by tools like the nix CLI—nix develop, for example, operates on the devShells output—nothing prevents you from defining your own flake output types.\n\u003e\n\u003e Unfortunately, such “non-standard” flake output types have a big problem: tools like nix flake show and nix flake check don’t know anything about them, so they can’t display or check anything about those outputs.\n\n## Examples\n\nGet a flake's output structure, without derivation and store path data.\nExcluding derivation and store path data means much less Nix evaluation, and a faster result:\n\n```bash\nnix eval --json \\\n    --override-input flake https://flakehub.com/f/DeterminateSystems/magic-nix-cache/0.1.341 \\\n    --no-write-lock-file 'https://flakehub.com/f/DeterminateSystems/inspect/*#contents.excludingOutputPaths' \\\n    | nix run nixpkgs#jq -- .\n\n```\n\nGet a flake's output structure, **with** derivation and store path data.\nCollecting derivation and store path data means a more extensive Nix evaluation:\n\n```bash\nnix eval --json \\\n    --override-input flake https://flakehub.com/f/DeterminateSystems/magic-nix-cache/0.1.341 \\\n    --no-write-lock-file 'https://flakehub.com/f/DeterminateSystems/inspect/*#contents.includingOutputPaths' \\\n    | nix run nixpkgs#jq -- .\n\n```\n\n## Example Output\n\nThe data below is representative of the general structure.\nIt incudes output paths and derivations, which would not be present in the output in the `contents.excludingOutputPaths` evaluation.\n\n```json\n{\n  \"docs\": {\n    \"devShells\": \"The `devShells` flake output contains derivations that provide a build environment for `nix develop`.\\n\",\n    \"packages\": \"The `packages` flake output contains packages that can be added to a shell using `nix shell`.\\n\"\n  },\n  \"inventory\": {\n    \"devShells\": {\n      \"children\": {\n        \"aarch64-darwin\": {\n          \"children\": {\n            \"default\": {\n              \"derivation\": \"/nix/store/lzfbsl05jw3ixbppm11nmfd4xzj81qhs-nix-shell.drv\",\n              \"forSystems\": [\"aarch64-darwin\"],\n              \"outputs\": {\n                \"out\": \"/nix/store/bq48b9naj2ihcwvc8vw6i98pj533qqbh-nix-shell\"\n              },\n              \"shortDescription\": \"\",\n              \"what\": \"development environment\"\n            }\n          }\n        },\n        \"aarch64-linux\": {\n          \"children\": {\n            \"default\": {\n              \"derivation\": \"/nix/store/d157gs8aqf2dizpk04wacbvwrzax23dq-nix-shell.drv\",\n              \"forSystems\": [\"aarch64-linux\"],\n              \"outputs\": {\n                \"out\": \"/nix/store/s05laifrbik2xs4ri7351hzld857garz-nix-shell\"\n              },\n              \"shortDescription\": \"\",\n              \"what\": \"development environment\"\n            }\n          }\n        }\n      }\n    },\n    \"packages\": {\n      \"children\": {\n        \"aarch64-darwin\": {\n          \"children\": {\n            \"default\": {\n              \"derivation\": \"/nix/store/z593dppy4xjmbkkjasmy92blgzgvnapy-magic-nix-cache-0.2.0.drv\",\n              \"forSystems\": [\"aarch64-darwin\"],\n              \"outputs\": {\n                \"out\": \"/nix/store/8lsqcz8vpx0s7mgcj33asrz0f99sr9ag-magic-nix-cache-0.2.0\"\n              },\n              \"shortDescription\": \"\",\n              \"what\": \"package\"\n            },\n            \"magic-nix-cache\": {\n              \"derivation\": \"/nix/store/z593dppy4xjmbkkjasmy92blgzgvnapy-magic-nix-cache-0.2.0.drv\",\n              \"forSystems\": [\"aarch64-darwin\"],\n              \"outputs\": {\n                \"out\": \"/nix/store/8lsqcz8vpx0s7mgcj33asrz0f99sr9ag-magic-nix-cache-0.2.0\"\n              },\n              \"shortDescription\": \"\",\n              \"what\": \"package\"\n            },\n            \"veryLongChain\": {\n              \"derivation\": \"/nix/store/wdgjivv50ks5d48z54wwrw29kpz9hmqh-chain-200.drv\",\n              \"forSystems\": [\"aarch64-darwin\"],\n              \"outputs\": {\n                \"out\": \"/nix/store/zjwhc6sj38cx2mms0nrl76cxaz70qd02-chain-200\"\n              },\n              \"shortDescription\": \"\",\n              \"what\": \"package\"\n            }\n          }\n        },\n        \"aarch64-linux\": {\n          \"children\": {\n            \"default\": {\n              \"derivation\": \"/nix/store/nl65gdz60cm3j774yqdfqr4hss5zl45b-magic-nix-cache-0.2.0.drv\",\n              \"forSystems\": [\"aarch64-linux\"],\n              \"outputs\": {\n                \"out\": \"/nix/store/6nr5b7kqhxw738fplg22dl16fsalx3kq-magic-nix-cache-0.2.0\"\n              },\n              \"shortDescription\": \"\",\n              \"what\": \"package\"\n            },\n            \"magic-nix-cache\": {\n              \"derivation\": \"/nix/store/nl65gdz60cm3j774yqdfqr4hss5zl45b-magic-nix-cache-0.2.0.drv\",\n              \"forSystems\": [\"aarch64-linux\"],\n              \"outputs\": {\n                \"out\": \"/nix/store/6nr5b7kqhxw738fplg22dl16fsalx3kq-magic-nix-cache-0.2.0\"\n              },\n              \"shortDescription\": \"\",\n              \"what\": \"package\"\n            },\n            \"veryLongChain\": {\n              \"derivation\": \"/nix/store/zk93kmbhk4b192w8176znd8p1g8wikv1-chain-200.drv\",\n              \"forSystems\": [\"aarch64-linux\"],\n              \"outputs\": {\n                \"out\": \"/nix/store/k1nvfr1nq7as02ckh4dd6lwvjxcca5ph-chain-200\"\n              },\n              \"shortDescription\": \"\",\n              \"what\": \"package\"\n            }\n          }\n        }\n      }\n    }\n  },\n  \"version\": 1\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeterminatesystems%2Finspect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeterminatesystems%2Finspect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeterminatesystems%2Finspect/lists"}