I want to open and use neovide as root, but when on any user profile
- I basically want to do this because everytime i have to change anything in my configuration file i have to go in there as root
- On top of that if i open neovide as a user it shows all the folders, through the telescope plugin, of which that user has access to, which is really nice when you just want to move around your system, really makes it feel like im in a terminal
- But when i try to go to the nixos folder with my configuration from neovide it doesnt show it to me through the telescope plugin, i can still navigate to it from netrw but kind of defeats the purpose of using neovide, at that point i might as well go back to the terminal
- I just want neovide to always open as root on any user account so that i can just navigate my entire system from there and i dont need to go back to the terminal just to edit a few files
This is a completely unnecessary endeavor and i realize that, but it is something i wish to do on my system because it is just a nicer way of doing things for me, if there is any way i can make this happen please let me know
Currently i have tried the following
Custom Script
I tried making a simple neovide-root.sh file with the following code
#!/bin/bash
su
cd /
neovide
and i ran it as bash neovide-root.sh
but all that ended up doing was switching to root and doing nothing, since i started the script in my user profile any effect that that script were to do would only occur in my profile, and if i were to exit and switch back to m user then the rest of the script would execute
Custom *.desktop File
i also tried making a neovide-root.desktop file by doing this
[Desktop Entry]
Type=Application
Terminal=True
Exec=sudo neovide "$@"
Category=Utility
and then i just ran it with rofi and it did turn on
but as you can imagine it was only given sudo privilages and not root ones
i also tried switching the Exec command to be su && neovide
and su neovide
but they just did the same thing as the script up above
Security.sudo in the Configuration file
i applied the sudo privilage, nopasswd setting in the configuration file by doing this
security.sudo = {
enable = true;
extraRules = [{
groups = [ "wheel" ];
commands = [
{
command = "/run/current-system/sw/bin/neovide";
options = [ "NOPASSWD" ];
}
];
}];
};
and i still didnt get root access
i however do think that this setting did function properly and the only reason i didnt get root access to files and folders is because of course as the setting itself says it gives sudo access to everything not root access, but i guess at this point i just hoped it would
These were all my attempts and hopefully someone can tell me that i want to do is possible and i dont have to back and forth between my terminal and neovide