Whenever I run any command line tools without sudo, they take the settings as in ~/.config and work fine. But whenever I run the same CLI tools with same parameters but with sudo, it falls back to default setting. How can I make this behavior consistent?
4 Comments
toyvo@programming.dev · 6 pts · 1y
Generally define the same config options for the root user in /root/.config
JohnnyMac@lemmy.world · 6 pts · 1y
clot27@lemm.ee · 1 pts · 1y
Thanks for the heads up! I will try the given solutions.
What do you exactly mean by this?
JohnnyMac@lemmy.world · 3 pts · 1y
MadhuGururajan@programming.dev · 2 pts · 1y
The letter ~ (tilde) is relative to the current user. When you use sudo, you become root. So ~ points to
/root. Whereas if you are not using sudo then ~ points to/home/yournamesudo@programming.dev · 5 pts · 1y
I run commands as the root user so I use the root users configs. Usually that's in
/root/.config/but it might be different in NixOS.You'll have to either copy your configs over to the root users config dirs. I highly recommend auditing what you copy though for security.