Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mitinarseny/dots

Delivery tool for dotfiles written in Go.
https://github.com/mitinarseny/dots

command-line configuration dotfiles

Last synced: 3 months ago
JSON representation

Delivery tool for dotfiles written in Go.

Awesome Lists containing this project

README

        



dots logo

dots


Delivery tool for your .dotfiles



Release
TravisCI
Codecov branch


Go Doc
Software License
SayThanks.io
Reviewed by Hound

[![dots demo](assets/demo.gif)](https://github.com/mitinarseny/dotfiles/blob/master/.dots.yaml)

---

## Table of Contents:
* [Installation](#install)
* [Usage](#usage)
* [Config file](#config-file)

## Install
To install with [`brew`](https://brew.sh) run this in your terminal:
```bash
brew install mitinarseny/tap/dots
```

## Usage
To set variables, create symlinks and execute commands listed in [config](#config-file) file run this:
```bash
dots up
```

#### Custom config file
By default [config](#config-file) file is `.dots.yaml` in current working directory.
If you want to specify other location, pass it to `-c` flag:
```bash
dots up -c custom/config.yaml
```

#### Specify hostname
You are free to choose what host to up:
```bash
dots up hostname
```
The default hostname is `default`.

## Config file
Config is a YAML file (defaults to `.dots.yaml` in current working directory).
An example config can be found in my [dotfiles](https://github.com/mitinarseny/dotfiles/blob/master/.dots.yaml).

On top-level config consists of hosts:
```yaml
host1:
variables:
# ...
links:
# ...
commands:
# ...
host2:
extends:
- host1
# ...
```
If not specifying the hostname when running `dots up`, the default will be `default`.

### `variables`
This section consists of list of stages, while each stage consists of environment variables.
```yaml
variables:
- name1: value1
name2: value2
- name3: $name1/$name2
- name4:
command: echo value4
description: this is equal to exporting name4=$(echo value4)
- name5:
command: echo "description can be omitted"
# ...
```

### `links`
This section is a mapping of target paths to destination paths. Targets must be absolute.
```yaml
links:
~/abs/target: rel/dest

~/another/abs/tagret:
path: another/rel/dest
force: true # enforce to recreate link if already exists

# link directory
~/dir1: dir1

# create in ~/dir2/ the same structure as in .dir/ and link all .sh files
~/dir2/: .dir/**.sh

~/dir3/:
path: .dir/with/dirs/**
dirs: true # enforce to link directories and do not traverse files in them
# ...
```
For more detailes on wildcards take a look an [standard wildcards](http://tldp.org/LDP/GNU-Linux-Tools-Summary/html/x11655.htm).

### `commands`
This section is a list of commands to execute. Each command may have a `description`.
```yaml
commands:
- echo command1

- description: simple description
command: echo command2

- description: this is a parent command
command: echo "parent"
commands:
- description: this is a subcommand
command: echo "child1"
commands:
- description: this is a subsubcommand
command: echo "child2"
# ...
```