aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/README.md
blob: a7dfef84f397a1fd291fee3c13bd6a4637698512 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# tobyvin's [.dotfiles]

## Install

```sh
git clone https://git.tobyvin.dev/.dotfiles && ./.dotfiles/install.sh
```

## Getting started

The configuration files are managed using GNU [stow] and the dotfiles can be
installed solely by running `stow */` from the repository's root.

### Install script

A [install.sh] helper script is provided that will stow packages and run package
specific install scripts. It can be run with `./install.sh [package ..]`,
defaulting to operating on all packages if none are specified.

It stows the packages using the `-R` (restow) option, which will remove any
broken or missing symlinks belonging to the repository. Normally this spams the
output with `UNLINK` and `LINK` for every file in every package, so it's piped
through a small awk script to filter the output to only non-reverted actions.

#### Package specific install scripts

The install script will run any package specific install scripts that exist in
the root of a package directory, e.g. `./<pkgname>/install.sh`.

Example usecases:

- Creating non-existent directories
- Enabling systemd user services
- Fixing file permissions
- Running one-time setup commands
- etc.

##### Example package install script

```sh
#!/bin/sh

pkgname=<pkgname>

if ! command -v "$pkgname" >/dev/null; then
 printf '%s: %s not found, skipping...\n' "$0" "$pkgname"
 exit 0
fi

mkdir -pv "${XDG_CACHE_HOME}/${pkgname}"

printf "%s: Installing service\n" "$0"
systemctl --user enable --now --no-block "${pkgname}.service"
```

More examples: [zsh], [pass], and [nvim]

## Mirrors

I host this repository (and many others) on my local [cgit] instance, but it is
also mirrored to both [SourceHut] and [GitHub].

[.dotfiles]: https://git.tobyvin.dev/.dotfiles
[cgit]: https://git.tobyvin.dev
[github]: https://github.com/tobyvin/.dotfiles
[install.sh]: ./install.sh
[nvim]: ./nvim/install.sh
[pass]: ./pass/install.sh
[sourcehut]: https://git.sr.ht/~tobyvin/.dotfiles
[stow]: https://www.gnu.org/software/stow/
[zsh]: ./zsh/install.sh