| Crates.io | dotlink |
| lib.rs | dotlink |
| version | 0.3.0 |
| created_at | 2023-04-20 11:06:29.627379+00 |
| updated_at | 2025-07-13 13:45:51.582911+00 |
| description | No non-sense dotfiles linker |
| homepage | |
| repository | https://github.com/TheRealLorenz/dotlink |
| max_upload_size | |
| id | 844278 |
| size | 34,134 |
A simple program that can help you link all your dotfiles in place.
Supports multiple presets, in order to avoid linking every file in every machine.
I've setup my own dotfiles repo with a dotlink.toml file.
In my case i simply clone the repo and run dotlink inside of it.
$ git clone https://github.com/TheRealLorenz/dotfiles.git
$ cd dotfiles
$ dotlink -p macOS
The program automatically picks up the config file inside the current working directory and links everything!
dotlink relies on a config file, named dotlink.toml.
In the config file you can specify multiple presets, where every presets is a vector of entries.
Presets are top level keys of the config file.
There are two types of entries:
[[preset_name]]
name = 'foo' # File name
to = '/path/to/destination' # Destination directory
rename = 'foo2' # Link name (optional, defaults to the file name)
[[preset_name]]
names = [ 'foo', 'bar', 'baz' ] # Multiple file names
to = '/path/to/destination/' # Destination directory
The program then simply symlinks every file specified by name or names to the corresponding to.
[[linux-wayland]]
names = [
'sway',
'sov',
'zsh',
'nushell',
'waybar'
]
to = '~/.config'
[[linux-wayland]]
name = 'rc.zsh'
to = '~/'
rename = '.zshrc'
[[linux-wayland]]
name = 'tmux.conf'
to = '~/'
rename = '.tmux.conf'
[[linux-xorg]]
names = [
'i3',
'polybar',
'zsh',
'nushell'
]
to = '~/.config'
[[linux-xorg]]
name = 'rc.zsh'
to = '~/'
rename = '.zshrc'
[[linux-xorg]]
name = 'tmux.conf'
to = '~/'
rename = '.tmux.conf'
[[server]]
name = 'tmux.conf'
to = '~/'
rename = '.tmux.conf'
[[macOS]]
name = 'zsh'
to = '~/.config'
[[macOS]]
name = 'rc.zsh'
to = '~/'
rename = '.zshrc'
[[macOS]]
name = 'tmux.conf'
to = '~/'
rename = '.tmux.conf'
[[macOS]]
name = 'nushell'
to = '~/Application Support'
The example above defines 4 presets: linux-wayland, linux-xorg, server, macOS.
Running dotlink -h will show the help message
Usage: dotlink [OPTIONS] [PATH]
Arguments:
[PATH]
Options:
-p, --preset <PRESET> Which preset to use [default: default]
-l, --list List available presets
-F, --file <FILE> Custom config file location
--dry-run Run dotlink in dry-run mode
-h, --help Print help
PATHrepresents the path to the dotfiles. Defaults to the current working directory.
Simply run
$ cargo install dotlink
Clone the repository
$ git clone https://github.com/TheRealLorenz/dotlink
Install with Cargo
$ cargo install --path dotlink