coliru

A minimal, flexible, dotfile installer
git clone https://git.ashermorgan.net/coliru/
Log | Files | Refs | README

A minimal, flexible, dotfile installer

asciicast

Features

With coliru you can:

Installation

Coliru binaries can be downloaded from the GitHub releases page.

Coliru can also be installed from source using Cargo:

CARGO_NET_GIT_FETCH_WITH_CLI=true cargo install --git https://git.ashermorgan.net/coliru/

# To uninstall:
# cargo uninstall coliru

Usage

Dotfile metadata is stored in a manifest file as a series of steps that can be executed conditionally based on tag rules. To install dotfiles, pass the location of the manifest file and the desired tag rules:

coliru manifest.yml --tag-rules tag1 tag2,tag3 ^tag4

Some other helpful options include:

Manifest File

Manifests are defined using YAML as an array of steps that are executed to install the dotfiles, which are located in the same directory as the manifest. Each step may contain an array of copy, link, and/or run commands, in addition to an array of tags (see below). Each command is run from the directory containing the manifest file, or relative to the ~/.coliru directory when installing over SSH.

Example YAML manifest (see examples/basic/ for a complete example dotfile repository):

steps:
  - copy:
    - src: gitconfig
      dst: ~/.gitconfig
    tags: [ windows, linux, macos ]

  - link:
    - src: bashrc
      dst: ~/.bashrc
    - src: vimrc
      dst: ~/.vimrc # Will create symbolic links on Linux & MacOS
    run:
    - src: ./script.sh
      prefix: sh # unecessary on Unix if script.sh is executable
      postfix: arg1 $COLIRU_RULES
    tags: [ linux, macos ]

  - link:
    - src: vimrc
      dst: ~/_vimrc # Will create hard link on Windows
    run:
    - src: script.bat
      postfix: arg1 $COLIRU_RULES
    tags: [ windows ]

Tags and Tag Rules

Tags enable the installation of a subset of manifest steps based on a set of tag rules. Tags are user-defined and may be used to specify a step's supported operating systems (e.g. linux, macos, and/or windows), privilege requirements (e.g. system vs user), or even the types of machines it applies to (e.g. personal, work, server, etc).

Tag rules are specified on the command line using the --tag-rules option. In order for the commands in a step to be executed, its tags must satisfy all of the tag rules. If no tags rules are provided, all manifest steps will be executed. Each tag rule contains a comma separated list of tags that can satisfy the rule. A leading caret (^) will negate the entire rule.

In other words, commas correspond to OR, carets to NOT, and the spaces between rules to AND. So --tag-rules A B,C ^D,E looks for steps with the tags A && (B || C) && !(D || E).

Development

Use Cargo to build, test, and run coliru:

cargo build
cargo test
cargo run -- --help

Some of coliru's integration and end-to-end tests interact with a test SSH server, which can be started with Docker Compose:

docker compose -f tests/server/compose.yml up