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

nix-collect-garbage -d should issue a warning when run as non-root user #1492

Open
chris-martin opened this issue Jul 27, 2017 · 5 comments
Open
Assignees
Labels
documentation error-messages Confusing messages and better diagnostics

Comments

@chris-martin
Copy link
Contributor

I've been using NixOS for about 16 months and I just now figured out that you have to run nix-collect-garbage as root to remove old NixOS builds. In retrospect, this probably should have been obvious to me, since it would be bad to allow non-root users to delete OS generations. Still I think it would be a good idea for nix-collect-garbage to print a something near the end of the output reminding the user that only their profile generations have been deleted, and that you need to run the command again with sudo if you want to delete OS generations.

@cleverca22
Copy link
Contributor

cleverca22 commented Aug 2, 2017

if ran as root, it can delete generations from all users, so no need to run it twice then

but yeah, it should probably also warn that it cant delete root's profiles

@dtzWill
Copy link
Member

dtzWill commented Aug 6, 2017

Agreed a message or warning would be nice 👍.

I like the current behavior but never hurts to make sure user is clear on what is (and isn't) happening :).

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/proposal-for-improving-nix-error-messages/6305/2

@domenkozar domenkozar added error-messages Confusing messages and better diagnostics and removed backlog labels Apr 30, 2020
@stale
Copy link

stale bot commented Feb 15, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Feb 15, 2021
@fricklerhandwerk fricklerhandwerk added documentation and removed error-messages Confusing messages and better diagnostics stale labels Sep 13, 2022
@fricklerhandwerk
Copy link
Contributor

This is a NixOS issue and something to be documented in the NixOS manual. @chris-martin please open an issue on NixOS/nixpkgs if you still care.

For Nix we should at least make more explicit in the manual that nix-collect-garbage -d only deletes the current user's profiles.

@fricklerhandwerk fricklerhandwerk added the error-messages Confusing messages and better diagnostics label Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation error-messages Confusing messages and better diagnostics
Projects
None yet
Development

No branches or pull requests

8 participants