this post was submitted on 23 May 2025
1 points (100.0% liked)

Nix / NixOS

2736 readers
1 users here now

Main links

Videos

founded 2 years ago
MODERATORS
 

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?

you are viewing a single comment's thread
view the rest of the comments
[–] JohnnyMac@lemmy.world 0 points 11 months ago* (last edited 11 months ago)

A lot of times sudo -E will solve these types of issues because it preserves current environments variables. Honestly it might be all that's needed to fix your current issue. I was just mentioning it so you know for the future.

I meant that it might not work because there's probably not an environment variable directly for .config. however if the program is coded to look at $HOME/.config then the -E would solve the problem.