yRice is a dotfile management helper written in rust based on a yaml configuration file.
This package is available on the AUR.
The latest x86 linux binary is available here.
Clone this repository and run sudo cargo install -path .
.
This will install the binary to cargo's bin
dir, which you need to add to your $PATH
(or you can manually move the binary to any directory in your $PATH
).
$ yrice -h
yrice 0.1.0
USAGE:
yrice [OPTIONS] [MODULES]...
ARGS:
<MODULES>...
OPTIONS:
-c, --config <CONFIG> Config path or URL
-d, --dry-run
-h, --help Print help information
-i, --install
-p, --pull Pull dotfiles
-V, --version Print version information
If using the -i
flag, yRice will install the system packages. See below for details.
If using the -p
flag, yRice will pull the dotfiles before running.
Note: If the dotfiles
dir does not exist, yRice will clone the gitUrl
remote to that directory.
yRice will get its configuration either from the path or url specified using the -c
flag or $XDG_CONFIG_DIR/yrice/config.yaml
(falling back to ~/.config/yrice/config.yaml
).
An example configuration can be found here. A more complete example is in my dotfiles.
The global
key is used to configure yRice itself :
installCommand
will be used to install packages, for example using your system's package manager (apt
,yum
,pacman
...)dotfiles
will tell yRice where to find the source configuration files for all the specified modulesgitUrl
will tell yRice which git remote to use for the dotfiles themselves
The variables
list will be used when a module file has parse
set to true
(see below for more detail).
The parsing is done using handlebars, simply replacing anything between {{...}}
with the variable content when enabled.
Modules are the heart of yRice. They define which programs are managed using yRice.
For each module, yRice will look for a folder named dirname
(defaulting to the module name) in the dotfiles
dir,
then try to install all specified files to targetDir
(defaulting to $XDG_CONFIG_DIR/dirname
or ~/.config/dirname
,
with dirname
defaulting to the module name).
If a file has parse
set to true
, yRice will parse the file and write it to the specified location, after having created a backup of the original file to targetDir/target.bak
.
If it is unset (or set to false
), the file will be softlinked and no backup will be created. Be careful when using this, as any current configuration files will be overwritten.
preSteps
and postSteps
will be run in a shell before or after the file was linked or written.
Examples:
-
Using the default module configuration
yrice: {}
, yRice will:- look for a folder named
yrice
indotfiles
- softlink this folder to
~/.config/yrice
- look for a folder named
-
With the following config, yRice will:
foo: files: - source: bar target: baz parse: true
- look for a file named
foo/bar
indotfiles
- replace any handlebars found in the file with the associated variable's content
- write the result to
~/.config/foo/baz
- Add url source for config
- Add git clone/push/pull/commit commands
- Include other yaml file
- Later: TUI
- look for a file named