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

Nix / NixOS

2206 readers
50 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
[–] [email protected] 3 points 22 hours ago* (last edited 10 hours 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, because XDG_CONFIG_HOME is probably what the app is looking for, which will get passed with -E without all the extra stuff in my first response.