Skip to content

Commit 135edaa

Browse files
committed
document ins dot root owned files
1 parent 0c04a1d commit 135edaa

1 file changed

Lines changed: 43 additions & 2 deletions

File tree

‎docs/insdot.md‎

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,49 @@ will pull them and install them to your home directory.
5555
`ins dot` will detect dotfiles modified by the user and ignore them during
5656
updates, while continuing to update untouched dotfiles.
5757

58+
## Root-owned dotfiles
59+
60+
`ins dot` also supports dotfiles that live outside your home directory, such
61+
as root-owned configs under `/etc`.
62+
63+
Root targets are stored in repository subdirectories whose name ends in
64+
`_root`. For example, a file like `dots_root/etc/ssh/sshd_config` is treated as
65+
the source for `/etc/ssh/sshd_config`.
66+
67+
Example workflow:
68+
69+
```bash
70+
# Add a root-owned config
71+
ins dot add /etc/ssh/sshd_config
72+
73+
# Inspect it with root paths included
74+
ins dot status /etc/ssh/sshd_config --include-root
75+
76+
# Apply the normal set plus any root targets
77+
ins dot apply --include-root
78+
79+
# Reset a root target
80+
ins dot reset /etc/ssh/sshd_config --include-root
81+
```
82+
83+
When `ins dot apply` or `ins dot reset` needs to write root-owned targets, it
84+
relaunches itself through `sudo` so the files can be written to `/` or `/etc`
85+
as needed.
86+
87+
`--include-root` includes root targets alongside home targets. It does not make
88+
the command root-only.
89+
90+
The following commands accept `--include-root` to include root targets in their
91+
normal output and operations:
92+
93+
- `ins dot apply`
94+
- `ins dot reset`
95+
- `ins dot update`
96+
- `ins dot status`
97+
- `ins dot diff`
98+
- `ins dot encrypt`
99+
- `ins dot decrypt`
100+
58101
```
59102
ins dot status
60103
```
@@ -595,5 +638,3 @@ preventing updates, which means automated usage is out of the question. Being
595638
written in Bash, it is also quite slow. It also does not allow applying
596639
dotfiles from multiple different repositories, something which Stow supports
597640
very well by accident.
598-
599-

0 commit comments

Comments
 (0)