Dotfiles needs some place to stay.
Scripts and settings that are useful for me. Based on many examples from other people’s dotfiles and configuration scripts.
Have moved to a Chezmoi managed installation, since it was a bit tricky to maintain dotfiles on many devices with various configs. And I want to use the same dotfiles directory for both Windows and Linux was an obstacle. But Chezmoi is the right tool for this. My workflow today is to use Chezmoi to control my setup of my systems, and I am less dependent on external scripts to do configuration and installation.
Install Chezmoi first, using file download, Scoop
, Winget
, Chocolatey
or other methods.
Backup the existing dotfiles directory before installing the new repository.
sh -c "$(curl -fsLS get.chezmoi.io)" -- -b "${HOME}/bin"
mkdir -p "${HOME}/.local/share"
chezmoi init --verbose sdaaish
chezmoi archive --output=tmp/dotfiles.tar.gz
chezmoi apply
* Chezmoi* can be downloaded directly or installed with Scoop or Chocolatey.
New-Item -Path $HOME -Name .local/share -ItemType Directory
New-Item -Path $HOME -Name bin -ItemType Directory
(irm -useb https://get.chezmoi.io/ps1) | powershell -c -
chezmoi init --verbose sdaaish
chezmoi archive --output=tmp/dotfiles.zip
chezmoi apply
I originally started out using dotfiles for Linux and copied them manually to where they belong. But later moved on to use Stow and hade a more automatic script to setup the dotfiles directory, using symlinks.
For Windows I started with just a folder for my scripts, moved on to a powershell module to setup things, used the linux dotfiles config and using symlinks, before using a bare repository approach, separate from Linux. WindotFiles
Symlinks on Windows require sometimes Administrator privileges, and a bare repository with the workdir in the Windows top folder makes git behave a bit erratic and sometimes slow. It works, but has some issues. For example Visual Studio Code didn’t like this.
To make things easier, (sort of), I moved to a Chezmoi setup where I can share the same dotfiles in the same repository both for Windows and Linux setups. Which makes sense with WSL and my Emacs configs.
Moving from two separate dotfiles setups to one common with Chezmoi is a bit tricky, but the overall experience is that it’s both fairly straightforward and worth the extra work.
But finally, a shared repository for Windows and Linux for my dotfiles, using Chezmoi.
Need to install fonts with get-nerd-fonts
before they are working with xterm.
To use git with WSL and not need to have an extra SSH key, use Git Credential Manager (GCM). This was released as GCM Core initially but has since then removed the -core extension.
And use the Windows SSH-Agent that has the keys, and forward the requests with npiperelay so can SSH also work with minimum setup.
[credential]
helper = /c/Program\\ Files/Git/mingw64/bin/git-credential-manager.exe
NOTE
git-credential-manager.exe
was called git-credential-manager-core.exe
in an earlier version of Git for Windows, so better check your version of git.
- Chezmoi
- Chezmoi creator dotfiles
- Bare dotfiles directory
- Awesome dotfiles
- Awesome Emacs config files
- Awesome Emacs
- http://wiki.bash-hackers.org/
To test chezmoi it’s possible to store it in a separate branch and use a separate destination directory to see how it works without changing the current installation. It’s also possible to take an archive of the target files before running the chezmoi apply
command.
To use a different branch for the setup and having submodules, requires that Git is installed in the PATH of the system.
chezmoi archive --output=tmp/dotfiles.tar.gz
chezmoi init --branch chezmoi --verbose sdaaish
chezmoi update --destination testpath --apply --dry-run
chezmoi archive --output=tmp/dotfiles.zip
chezmoi init --branch chezmoi --verbose sdaaish
chezmoi update --destination testpath --apply --dry-run