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

[Corepkgs] Have __structuredAttrs on by default #9

Open
jonringer opened this issue Nov 6, 2024 · 1 comment
Open

[Corepkgs] Have __structuredAttrs on by default #9

jonringer opened this issue Nov 6, 2024 · 1 comment

Comments

@jonringer
Copy link
Contributor

Really tired of stringly typed bash. Let's make this a bit nicer https://nixos.mayflower.consulting/blog/2020/01/20/structured-attrs/

@blaggacao
Copy link

blaggacao commented Nov 9, 2024

As can be seen from this example, two files—.attrs.sh and .attrs.json—are created if __structuredAttrs is set to true. The JSON file contains all attributes passed to derivation serialised by Nix in the same manner the builtins.toJSON built-in function works; the shell file contains all parameters that are at most one level deep, with Nix lists being converted to Bash arrays and Nix attribute sets to Bash associative arrays. All data nested deeper than one level is only included in the JSON file.

(gist from the article)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants