+
Skip to content

arran4/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

arran4 dotfiles

I have maintained a consistent dot file since I think 2004ish perhaps a bit earlier. This repo represents a complete rewrite. (I have another repo for my older dot configs which earliest commit was 2007ish.. But I had been using it via diff+ssh, rcs, svn, and finally git. But I didn't port RCS into SVN so I had lost earlier history.) --- Anyway. Enjoy.

I have a lot of things here that was specific to a particular place and time which are probably no longer relevant, porting them to chezmoi was I guess for my own interest sake.

Usage

I recommend you copy and paste the good stuff out into your own chezmoi config rather than just mine there is a lot of config here which is specific to me or specific to a particular situation I had been in in the past.

Using chezmoi https://www.chezmoi.io/

If chezmoi prints warning: config file template has changed, rerun chezmoi init --apply arran4 to regenerate the configuration from .chezmoi.toml.tmpl.

Notes

I don't think it's a good idea just to apply my dot files on to your system as there are a lot of configuration options and scripts I have put in intentionally, these could go unnoticed or taken for granted (which will make switching to other systems harder.) Saying that please pick out what you like / want. I am also happy to take suggestions in the form of PR or issues.

Benefits

Using these dotfiles provides a quick way to bootstrap a consistent development environment across multiple platforms. Everything is driven by chezmoi so you can apply or customize the configuration with a single command.

Highlights include:

  • Zsh and Bash setups with a shared prompt and a library of useful aliases (see .chezmoitemplates).
  • .gitconfig.tmpl that wires in the best available editor, color output and credential helpers.
  • Minimal tmux config with mouse mode and zsh as the default shell.
  • Quickshell configuration derived from caelestia-dots/shell with Nix-only pieces stripped.
  • Example .vimrc and support files for Vim or Neovim.
  • OS-aware templates (.chezmoi.toml.tmpl) that select paths and tools based on your platform.
  • Scripts for one-time tasks located in .chezmoiscripts/ that run automatically on the first apply.
  • Conditional .chezmoiignore rules skip local executables like gh-release.sh when dependencies such as the GitHub CLI (gh) are absent.

Feel free to copy individual pieces or adapt the whole setup to suit your needs.

Try it out

  1. Clone the repository and run ./install.
  2. Version checks run during setup using a PATH built from the paths defined in .chezmoi.toml.tmpl and warn only when a tool is older than the listed minimum version or the comparison fails.
  3. Open a new terminal and check the prompt, aliases and git settings.
  4. Start tmux to see the multiplexer configuration.
  5. Inspect .chezmoitemplates to learn how the templates are structured.

Flutter setup troubleshooting

If you install Flutter using bin/installtool flutter or manually unpack the SDK and flutter doctor reports issues, try the following fixes:

  • Dart executable precedence: Ensure ~/sdk/flutter/bin (or ~/libs/flutter/bin) appears before any system Dart installation in your PATH. .chezmoi.toml.tmpl now records those Flutter SDK locations and path-discovery.tmpl prepends them automatically when they exist, but open a new shell to load the change.
  • Android command-line tools: Open Android Studio, go to More Actions → SDK Manager → SDK Tools and install Android SDK Command-line Tools (latest). With the tools installed, run flutter doctor --android-licenses to accept the SDK licences. The chezmoi configuration now discovers SDKs in ~/Android/Sdk, ~/sdk/Android/Sdk, ~/lib/Android/Sdk, ~/sdk/android-sdk, ~/lib/android-sdk, and their *-linux variants, exports ANDROID_HOME/ANDROID_SDK_ROOT, and prepends the command-line tools plus platform-tools directories automatically.
  • Chrome for web development: Install a Chromium-based browser. .chezmoi.toml.tmpl picks the first browser (google-chrome-stable, google-chrome, chromium, chromium-browser, or chrome) available on the combined PATH it builds, and path-discovery.tmpl exports that location as CHROME_EXECUTABLE when the variable is unset.

Encrypting credentials with ejson

Use ejson to store secrets such as a GitLab OAuth client ID. Create an encrypted file named private_gitlab_oauth.ejson:

  1. Install ejson.

  2. Generate a keypair and save the secret key:

    ejson keygen -w

    Note the printed public key and keep the private key in the output path.

  3. Create private_gitlab_oauth.ejson containing your public key and OAuth client ID:

    {
      "_public_key": "<public key>",
      "gitlab_oauth_client_id": "<your client ID>"
    }
  4. Encrypt the file:

    ejson encrypt private_gitlab_oauth.ejson

Store the private key where ejson can read it when applying your dotfiles. Feel free to change the JSON keys to suit whichever credentials you need to encrypt.

Git template files

Git initialises new repositories using the contents of ~/.config/git/template. chezmoi copies everything under dot_config/git/template into this directory. Update the stub README.md and .gitignore files there to provide your own defaults for new repositories, then run chezmoi apply to install them.

KDE setup

Chezmoi includes a run-once script that sets KDE's super user command to sudo when kwriteconfig6 is present. If you install KDE after applying these dotfiles, run chezmoi apply again to trigger the script.

Git editor selection

dot_gitconfig.tmpl chooses a default editor based on what is installed. On Windows it searches the directories pointed to by the ProgramFiles, ProgramFiles(x86) and SystemRoot environment variables. GUI tools are preferred: notepad++, gvim, Visual Studio Code (code), IntelliJ (idea64) and finally plain notepad. Other systems use neovim or vim when available. If you want a different editor, override the setting after applying the dotfiles:

git config --global core.editor <command>

## SSH configuration

The default SSH configuration adds keys to your agent, stores passphrases in the
macOS keychain and limits authentication to the specified identities:

```sshconfig
Host *
  UseKeychain yes
  AddKeysToAgent yes
  IdentitiesOnly yes

To disable or override these options, create another Host block with your preferred values. For example:

Host legacy.example.com
  UseKeychain no
  AddKeysToAgent no
  IdentitiesOnly no

Foot terminal emulator

These dotfiles include a template for foot, a fast Wayland terminal. Install foot from your package manager and apply the configuration:

chezmoi apply

To make foot the default terminal on systems that support update-alternatives, run:

sudo update-alternatives --set x-terminal-emulator /usr/bin/foot

About

Just a collection of dotfiles managed by Chezmoi

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载