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

Fails to read nixos-rebuild output correct #116

Open
TheArcaneBrony opened this issue Sep 26, 2023 · 10 comments
Open

Fails to read nixos-rebuild output correct #116

TheArcaneBrony opened this issue Sep 26, 2023 · 10 comments
Labels
enhancement New feature or request

Comments

@TheArcaneBrony
Copy link

Output is spammed with @nix {"action":"start"... and seems to miss a lot of steps.
Screenshot from 2023-09-26 14-17-05

@TheArcaneBrony
Copy link
Author

Update: seems to be related to unbuffer

@maralorn
Copy link
Owner

Can you please share the command you ran?

@TheArcaneBrony
Copy link
Author

TheArcaneBrony commented Sep 29, 2023

unbuffer nixos-rebuild switch --flake .#Rory-nginx -j`nproc` --upgrade-all --log-format internal-json -v |& nom --json

@maralorn
Copy link
Owner

I am surprised that this is working at all. But I agree it’s weird that it works for some lines and doesn‘t for others.

@maralorn maralorn added enhancement New feature or request and removed looking for reproducer needs-triage labels Sep 30, 2023
@TheArcaneBrony
Copy link
Author

if this is marked as an enhancement, i wonder if we could get a nom os-rebuild subcommand or similar?

@maralorn
Copy link
Owner

maralorn commented Oct 2, 2023

The wish for a nom supported nixos-rebuild has been voiced before. And is definitely an open feature request. But I think it is more about changing nixos-rebuild than solving this in nom.

The enhancement request that I see in this issue would be "make the --json parser cleanly pass-through non json lines and correctly detect all json lines." I consider this an enhancement and not a bug because the --json parser was never supposed to be used on non-json input.

@TheArcaneBrony
Copy link
Author

what i personally ended up doing was using nom build to build the system closure and then using nixos-rebuild afterwards to deploy it

nom build .#nixosConfigurations.${2}.config.system.build.toplevel && sudo nixos-rebuild switch --flake .#${HOSTNAME} || exit 1

@mibmo
Copy link

mibmo commented Feb 3, 2024

does anyone know if there are any downsides to @TheArcaneBrony's approach? seems pretty good to me, all things considered :)

@maralorn
Copy link
Owner

maralorn commented Feb 3, 2024

No, that’s basically what I do.

@becknik
Copy link

becknik commented Apr 3, 2024

You might find the nh cli helper particularly useful when it comes to using nom in conjunction with nixos-rebuild.

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

No branches or pull requests

4 participants