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
virtualization/amazon-init: log multiple nix channels, fix nix path. #76585
virtualization/amazon-init: log multiple nix channels, fix nix path. #76585
Conversation
34d361d
to
1e81e72
Compare
I've built an AMI from this, spun up an EC2 instance with userdata as such:
And it works as expected. |
Guess I was too tired last night. This change only affects the log output about what channels are being added. It's still probably good to fix it. |
The missing `\n` in the printf format string prevented multiple channels from being logged. The missing `nixpkgs=` in the `NIX_PATH` prevented `nixos-rebuild` from working if the system configuration has any reference to `nixpkgs`. Additionally: * Use process substitution instead of piping printf to avoid creating a subshell. * Set an empty `IFS` to avoid word splitting. * Add the `-r` flag to `read` to avoid mangling backslashes.
1e81e72
to
76ad649
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also ran into this issue. Fix looks good
I've added |
I think having git available in these images would be useful, especially since "cloud-init" based provisioning is likely to need to fetch more expressions. Thanks for the PR. |
and I'm sorry for the wait :) |
Hey, thanks for merging, but I still needed to add gnutar (apparently will be fixed in nix 2.4, but in the meantime...) and git to PATH. And one more thing I forgot. I'll check our fork and send another PR tomorrow.
Sorry for not getting the patch ready in time for merge.
--
Enviado desde mi dispositivo Android con K-9 Mail. Por favor, disculpa mi brevedad.
|
No worries -- these improvements were improvements which stand on their own :) |
Motivation for this change
The missing
\n
in the printf format string prevented multiple channels frombeing logged.
The missing
nixpkgs=
in theNIX_PATH
preventednixos-rebuild
from workingif the system configuration has any reference to
nixpkgs
.Things done
Add missing
\n
.Fix
NIX_PATH
.Additionally:
IFS
to avoid word splitting.-r
flag toread
to avoid mangling backslashes.sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)