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

error: executing '/nix/store/.../bin/bash': Argument list too long #227

Open
catwith1hat opened this issue Dec 11, 2023 · 1 comment · May be fixed by #228
Open

error: executing '/nix/store/.../bin/bash': Argument list too long #227

catwith1hat opened this issue Dec 11, 2023 · 1 comment · May be fixed by #228

Comments

@catwith1hat
Copy link

catwith1hat commented Dec 11, 2023

Agenix seems to be limited to around 60 secrets and if you try to add more, the process building your host derivation will die with Argument list too long.

[foo:rebuild] building '/nix/store/2shq4mwinwqsc30469mzjg94v17ync8h-nixos-system-foo-23.11.20231207.64cd15e.drv'...
[foo:rebuild] error: builder for '/nix/store/2shq4mwinwqsc30469mzjg94v17ync8h-nixos-system-foo-23.11.20231207.64cd15e.drv' failed with exit code 1;
[foo:rebuild]        last 1 log lines:
[foo:rebuild]        > error: executing '/nix/store/q1c2flcykgr4wwg5a6h450hxbk4ch589-bash-5.2-p15/bin/bash': Argument list too long
[foo:rebuild]        For full logs, run 'nix log /nix/store/2shq4mwinwqsc30469mzjg94v17ync8h-nixos-system-foo-23.11.20231207.64cd15e.drv'.
task: Failed to run task "foo:rebuild": exit status 1
task: Failed to run task "foo:rebuild": exit status 1

Inspecting /nix/store/2shq4mwinwqsc30469mzjg94v17ync8h-nixos-system-foo-23.11.20231207.64cd15e.drv shows a very repetative action snippet which I traced back to installSecret inside age.nix. This installSecret snippet isn't that long but gets replicated for every secret here via:

    ++ (map installSecret (builtins.attrValues cfg.secrets))

I would suggest that installSecret becomes a bash function and then we just call this bash function instead of replicating the installSecret template over and over again. I will open a PR to illustrate this idea.

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

Successfully merging a pull request may close this issue.

1 participant