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

Panic if no USER variable is set #4

Open
Mynacol opened this issue Apr 21, 2024 · 1 comment
Open

Panic if no USER variable is set #4

Mynacol opened this issue Apr 21, 2024 · 1 comment

Comments

@Mynacol
Copy link

Mynacol commented Apr 21, 2024

Your code currently unconditionally tries to get the USER environment variable which results in a program abort. That happens if you nixos-rebuild --target-machine [somewhere].

Full log:

thread 'main' panicked at src/main.rs:18:10:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@Mynacol Mynacol changed the title Panick if no USER variable is set Panic if no USER variable is set Apr 21, 2024
@Mynacol Mynacol changed the title Panic if no USER variable is set Panic if no USER variable is set Apr 21, 2024
@thefossguy
Copy link
Owner

Again, as I mentioned here, this is really intended to be executed in a systemd service that runs after nixos-upgrade.service.

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