| 1 |
# Manage system dotfiles |
| 2 |
|
| 3 |
Dotdrop doesn't allow to handle file owernership (at least not directly). Every file operation (create/copy file/directory, create symlinks, etc.) is executed with the rights of the user calling dotdrop. |
| 4 |
|
| 5 |
Using dotdrop with `sudo` to manage unprivileged and privileged files in the same *session* is a bad idea as the resulting files will all have messed-up owners. |
| 6 |
|
| 7 |
It is therefore recommended to have two different config files (and thus two different *dotpath*s) |
| 8 |
for handling these two uses cases: |
| 9 |
|
| 10 |
For example: |
| 11 |
|
| 12 |
* One `config-user.yaml` for the local/user dotfiles (with its dedicated *dotpath*, for example `dotfiles-user`) |
| 13 |
* One `config-root.yaml` for the system/root dotfiles (with its dedicated *dotpath*, for example `dotfiles-root`) |
| 14 |
|
| 15 |
`config-user.yaml` is used when managing the user's dotfiles: |
| 16 |
```bash |
| 17 |
## user config file is config-user.yaml |
| 18 |
$ dotdrop import --cfg config-user.yaml <some-dotfile> |
| 19 |
$ dotdrop install --cfg config-user.yaml |
| 20 |
... |
| 21 |
``` |
| 22 |
|
| 23 |
`config-root.yaml` is used when managing the system's dotfiles and is to be used with `sudo` or directly by the root user: |
| 24 |
```bash |
| 25 |
## root config file is config-root.yaml |
| 26 |
$ sudo dotdrop import --cfg=config-root.yaml <some-dotfile> |
| 27 |
$ sudo dotdrop install --cfg=config-root.yaml |
| 28 |
... |
| 29 |
``` |
| 30 |
|
| 31 |
When commiting the local and system wide changes git will complain about permission. To fix that run: |
| 32 |
``` |
| 33 |
$ sudo chown -R <user>:<user> <system-wide-dotfiles> |
| 34 |
``` |