-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
handle permissions issues for --update
arg
#101
Conversation
Might address #79 |
I don't know the purpose of this. Nix already complains with |
to handle the error ourselves :) |
another option is wrapping the update command with |
But thinking about it, an error in the update command might be caused by other things, so it sounds reasonable to pre-check for the flake.lock permission error. Although I would add a message saying that nh doesn't support updating flakes owned by root |
Error message is a bit better now. Side note, I was unable to test this because even when my flake.lock is owned by root, it can still update on my system. So, testing on a sane system would be appreciated. |
Side note, the file check should probably go into |
Does nh attempt to read flake.lock before the rebuild? Looks like permission denied error is given before we can reach the check. |
In home.rs, it is read some lines before to check for the HM output |
I'm currently testing with |
no |
Then I have no idea why we are not getting the custom error message. |
it's so over |
nhover |
@NotAShelf should I close this PR? |
If you are uninterested in figuring out why the behaviour occurs, feel free. |
Tries to open
flake.lock
with both read and write permissions (which should, in theory, be enough to avoid failures due to flake.lock being owned by root.If it fails (e.g., due to insufficient permissions or the file not existing), it bails with the error message and a short warning.