Currently, the JSON output produced by devour-flake has two issues:
-
Name collisions in byName index: When building for multiple systems (via --override-input systems), packages with the same name from different systems overwrite each other in the byName mapping. Only the last system's package survives.
-
Flat structure lacks system organization: The current output doesn't clearly separate which outputs belong to which system, making it difficult to consume the data programmatically.
Current JSON structure:
{
"outPaths": [...],
"byName": {
"hello": "/nix/store/...-hello-aarch64" // x86_64 version was lost!
}
}
Proposed JSON structure:
{
"x86_64-linux": {
"outPaths": [...],
"byName": {
"hello": "/nix/store/...-hello-x86_64",
"firefox": "/nix/store/...-firefox-123"
}
},
"aarch64-linux": {
"outPaths": [...],
"byName": {
"hello": "/nix/store/...-hello-aarch64",
"firefox": "/nix/store/...-firefox-123"
}
}
}
Benefits:
- No more name collisions - each system has its own
byName namespace
- Clear system organization makes it easier to process outputs programmatically
- Sorted
outPaths within each system for predictable ordering
- The text output (default) remains unchanged, continuing to list all paths across all systems
Additional improvements:
- Sort
outPaths lexicographically for consistent output
Currently, the JSON output produced by devour-flake has two issues:
Name collisions in
byNameindex: When building for multiple systems (via--override-input systems), packages with the same name from different systems overwrite each other in thebyNamemapping. Only the last system's package survives.Flat structure lacks system organization: The current output doesn't clearly separate which outputs belong to which system, making it difficult to consume the data programmatically.
Current JSON structure:
{ "outPaths": [...], "byName": { "hello": "/nix/store/...-hello-aarch64" // x86_64 version was lost! } }Proposed JSON structure:
{ "x86_64-linux": { "outPaths": [...], "byName": { "hello": "/nix/store/...-hello-x86_64", "firefox": "/nix/store/...-firefox-123" } }, "aarch64-linux": { "outPaths": [...], "byName": { "hello": "/nix/store/...-hello-aarch64", "firefox": "/nix/store/...-firefox-123" } } }Benefits:
byNamenamespaceoutPathswithin each system for predictable orderingAdditional improvements:
outPathslexicographically for consistent output