rrcm
Introduction
- Deploy configuration files and directories using symbolic links.
- Configuration files and directories are managed in a git repository.
- Provides deployment on multiple OS from the same directory.
Provides the location of these directories by leveraging the mechanisms defined by
- the XDG base directory specifications on Linux and macOS
- the Known Folder API on Windows
Installation
Cargo
# initialize config file
Configuration
The configuration file is a yaml file. configuration file path:
- Unix: $HOME/.config/rrcm/config.yaml
- Win: %PROFILE%\AppData\Roaming\rrcm\config.yaml
Repository
The repository is defined in the config.yaml file.
repos:
# your dotfiles repository
# you can define multiple repositories
example1: 'git@github:example/example1'
example2: 'git@github:example/example2'
the repository is a directory that contains the dotfiles. Directory structure example:
dotfiles
├── home
│ ├── .profile /.profile
│ │ %PROFILE%\.profile
│ └── ...
├── config
│ ├── nushell /.config/nushell,
│ │ %PROFILE%\AppData\Roaming\nushell
│ └── ...
└── config_local
├── nvim /.config/nvim,
│ %PROFILE%\AppData\Local\nvim
└── ...
home, config, config_local are the deployment targets.
- home: Deploy to $HOME(Unix), %PROFILE%(Win)
- config: Deploy to $HOME/.config(Unix), %PROFILE%\AppData\Roaming(Win)
- config_local: Deploy to $HOME/.config/local(Unix), %PROFILE%\AppData\Local(Win)
Under the deployment target, the file or directory is deployed by symbolic link. Windows needs to be run as administrator.
Deployment target
The deployment target is defined in the config.yaml file.
deploy:
home:
windows: "%USERPROFILE%"
mac: "${HOME}"
linux: "${HOME}"
config:
windows: "%FOLDERID_RoamingAppData%"
mac: "${XDG_CONFIG_HOME}"
linux: "${XDG_CONFIG_HOME}"
config_local:
windows: "%FOLDERID_LocalAppData%"
mac: "${XDG_CONFIG_HOME}"
linux: "${XDG_CONFIG_HOME}"
Environment variables can be used in the deployment target. Format
- Unix: ${ENVIRONMENT_VARIABLE_NAME}
- Windows: %ENVIRONMENT_VARIABLE_NAME%
The following special variables are available.
- Unix XDG base directory
if the environment variable is not set, the default value is used.
- ${XDG_CONFIG_HOME}
- ${XDG_DATA_HOME}
- ${XDG_CACHE_HOME}
- ${XDG_RUNTIME_DIR}
- Windows Known Folder ID
- %FOLDERID_RoamingAppData%
- %FOLDERID_LocalAppData%
- %FOLDERID_Documents%
- %FOLDERID_Desktop%
Examples
# update all repositories
# show status all repositories