Apply a base configuration to a system, quickly!
It reads a configuration and template structure from a [dotfiles] directory and tries to normalize the machine that it is run base on this configuration.
Until Rust Edition 2018 is released, this crate is Nightly Only.
WARNING: This will modify your system and potentially overwrite files! Make sure you have backed everything up before using it!
quickcfg
binary and your configuration repo.copy-dir
), which does a lot of work
with very little configuration.Create a repository with a quickcfg.yml
in its root:
``` hierarchy: - secrets.yaml - db/common.yaml - db/{distro}.yaml
systems: # System to copy an entire directory to another. - type: copy-dir from: root:./home to: home:. templates: true # System to ensure that a set of packages are installed. - type: install-packages # Will download and run the downloaded script once, recording it as done under the provided ID. - type: download-and-run id: install-rust url: https://sh.rustup.rs - type: download-and-run id: install-oh-my-zsh url: https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh shell: true # Create a symlink. - type: link path: home:.vimrc link: .vim/vimrc ```
copy-dir
Copies a directory recursively.
yaml
from: root:./some/dir
to: home:some/dir
templates: false
Will copy a directory recursively.
install-packages
Compares the set of installed packages, with a set of packages from the hierarchy to install and installs any that are missing.
Will use sudo
if needed to install packages.
```yaml type: install-packages
provider: pip3
key: pip3::packages ```
The simplest example of this system is the one that uses the primary provider:
yaml
systems:
- type: install-packages
This will look up packages under the packages
key and install it using the primary provider for
the system that you are currently running.
These are the supported providers:
debian
: For Debian-based systems.download-and-run
Downloads a script of the internet and runs it once.
yaml
type: download-and-run
id: install-oh-my-zsh
url: https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh
shell: true
The id
is to uniquely identify that this system has only been run once.
link
Creates a symlink.
type: link
path: home:.vimrc
link: .vim/vimrc
This creates a symbolic link at path
which contains whatever is specified in link
.
We support installing packages on the following platforms:
dpkg-query
and apt
(fact: distro=debian
).Any file being copied is treated as a [handlebars
] template.
Any template file can make use of hierarchy data, by specifying their dependencies using
a quickcfg:
tag at the top of the file, like this:
```
Hi, my name is {{name}} ```
quickcfg
will scan the first 5 lines of any file being copied for this.