Giter Site home page Giter Site logo

dotfiles's Introduction

README

Options

Description

Dotfiles needs some place to stay.

Scrips and shell-settings that are useful for me. Based on many examples from other people’s dotfiles and configuration scripts.

Moving to a Chezmoi managed installation, since it was a bit tricky to maintain dotfiles on many devices with various configs. And want to use the same dotfiles directory for both Windows and Linux was an obstacle. But Chezmoi seems to be the right tool for this. Have started using it for my systems, still things that needs to be configured.

Install

Some test of chezmoi required the .local/share folder to be created before it worked. And also to have Git installed for submodules to clone properly.

Linux

chezmoi archive --output=tmp/dotfiles.tar.gz
sh -c "$(curl -fsLS get.chezmoi.io)" -- -b "${HOME}/bin"
mkdir -p "${HOME}/.local/share"
chezmoi init --verbose sdaaish

Windows

Chezmoi can be downloaded directly or installed with Scoop or Chocolatey.

chezmoi archive --output=tmp/dotfiles.zip
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

Other info

History of my dotfiles journey

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.

Linux

Need to install fonts with get-nerd-fonts before they are working with xterm.

Windows

Git and WSL

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.

Links

Testing

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.

Linux

chezmoi archive --output=tmp/dotfiles.tar.gz
chezmoi init --branch chezmoi --verbose sdaaish
chezmoi update --destination testpath --apply --dry-run

Windows

chezmoi archive --output=tmp/dotfiles.zip
chezmoi init --branch chezmoi --verbose sdaaish
chezmoi update --destination testpath --apply --dry-run

dotfiles's People

Contributors

sdaaish avatar sddixie avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Forkers

hackelibang

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.