Configuration ethics (esthetics): /etc vs $HOME

configurationdirectory-structureetchome

Ok this may not be a very concrete question, and is perhaps subject to taste, yet I'm struggling to get this right so here it goes.

I have a computer.
This computer has linux on it (thank god). Arch Linux to be specific (with awesome wm).
I am the single user on this computer.

As to good practice I've set up two users: the root user and the everyday use romeovs user. This way I only use permissions when needed (using sudo for example).

Over the years I have been pimping out my software suite, adding a bunch of applications to this computer. Notably: vim, git, mpc, mutt, calcurse, ufw, …

Now here is the rub: which of these applications' config files do I use? All of these supply an /etc-based global configuration file, that affects all users, as well as a local ~/.config (or, sadly, ~/) config options.

I've always worked using the local configuration setups, because this felt more natural. But as I grow more familiar with my computer, I feel this somehow lacks elegance. The contra's to this approach are:

  • dicrepancy when switching to root user, even with sudo (e.g. when using vim)

  • will not always work, e.g. when loading deamons from the arch linux DEAMONS
    array they are run by the root user and thus don't pick up local user configs.

  • major $HOME directory clutter. Sadly there are very few apps that adhere to the $XDG_CONFIG_HOME philosophy.

Benefits are:

  • stuff is local, which feels more in the lines of the permissions splitting between root and romeovs.

  • quick and easy acces to the files. no need to sudo to edit them.

  • easier for git tracking of the config files.

  • somehow feels safer: a user can screw stuff up without messign with the machine's global settings.

  • it is more "a-package-update-may-overwite-my-config"-proof

Let's get conrete:

What is the de-facto standard to split configuration on a single user machine, especially for the system maintainer (single-user)?

Best Answer

One day you're going to change your computer, or to give someone else (a family member, for example) an account on your computer.

  • If you want to keep a setting on your next computer, put it in your home directory.
  • If the other person might want a different setting, put it in your home directory.
  • If the setting is computer-dependent and not user-dependent, put it in /etc.

Your arguments against putting configuration files in the home directory don't really hold water:

  • sudo keeps the HOME environment variable (unless you've told it not to). So your programs will keep reading their settings from your home directory.
  • Daemons are not supposed to read your personal settings. Daemons are normally configured through files in /etc, not through environment variables or through files in your home directory.
  • $HOME is supposed to have a lot of dot files. That's why ls doesn't show them.
Related Question