OS Specific Configuration
You can specify different behaviors per OS in all configuration files.
Rotz can differentiate between Windows, Linux and MacOS.
To specify OS Specific behavior you need to add top level keys named linux
, windows
, darwin
(for MacOS) and general
(applied to all OSs).
- yaml
- toml
- json
Example: dots.yaml
windows:
installs:
cmd: scoop install {{ name }}
depends:
- scoop
- extras
darwin:
installs:
cmd: brew install {{ name }}
depends:
- brew
Example: dots.toml
[windows]
[windows.installs]
cmd = 'scoop install {{ name }}'
depends = [
'scoop',
'extras',
]
[darwin]
[darwin.installs]
cmd = 'brew install {{ name }}'
depends = [
'brew',
]
Example: dots.json
{
"windows": {
"installs": {
"cmd": "scoop install {{ name }}",
"depends": [
"scoop",
"extras"
]
}
},
"darwin": {
"installs": {
"cmd": "brew install {{ name }}",
"depends": [
"brew"
]
}
}
}
- yaml
- toml
- json
Example: neovim/dot.yaml
windows:
links:
ginit.vim: ~/AppData/Local/nvim/ginit.vim
init.vim: ~/AppData/Local/nvim/init.vim
global:
links:
ginit.vim: ~/.config/nvim/init.vim
init.vim: ~/.config/nvim/ginit.vim
Example: neovim/dot.toml
[windows]
[windows.links]
'ginit.vim' = '~/AppData/Local/nvim/ginit.vim'
'init.vim' = '~/AppData/Local/nvim/init.vim'
[global]
[global.links]
'ginit.vim' = '~/.config/nvim/init.vim'
'init.vim' = '~/.config/nvim/ginit.vim'
Example: neovim/dot.json
{
"windows": {
"links": {
"ginit.vim": "~/AppData/Local/nvim/ginit.vim",
"init.vim": "~/AppData/Local/nvim/init.vim"
}
},
"global": {
"links": {
"ginit.vim": "~/.config/nvim/init.vim",
"init.vim": "~/.config/nvim/ginit.vim"
}
}
}
You can also combine multiple OSs per key separating them with a |
.
- yaml
- toml
- json
Example: dots.yaml
windows:
installs:
cmd: scoop install {{ name }}
depends:
- scoop
- extras
darwin|linux:
installs:
cmd: brew install {{ name }}
depends:
- brew
Example: dots.toml
[windows]
[windows.installs]
cmd = 'scoop install {{ name }}'
depends = [
'scoop',
'extras',
]
['darwin|linux']
['darwin|linux'.installs]
cmd = 'brew install {{ name }}'
depends = [
'brew',
]
Example: dots.json
{
"windows": {
"installs": {
"cmd": "scoop install {{ name }}",
"depends": [
"scoop",
"extras"
]
}
},
"darwin|linux": {
"installs": {
"cmd": "brew install {{ name }}",
"depends": [
"brew"
]
}
}
}