Skip to content

Dotfiles

The dotfiles template allows to implement layers and conditional logic in your dotfiles. With layers you can have a dotfile in Macos but not in Ubuntu. With conditional logic you can have optional blocks. Secrets are managed like in other projects with environment variables. The template function lookup-env is resolving environment variables.

[user]
email = 32617+amiorin@users.noreply.github.com
name = Alberto Miorin
[pull]
ff = only
rebase = true
[init]
defaultBranch = main
{%- if profile = "macos" %}
[url "https://{{ "GITHUB_TOKEN" | lookup-env }}:x-oauth-basic@github.com/"]
insteadOf = https://github.com/
{%- endif %}

BigConfig requires Clojure and Babashka. You should also configure dirvenv for your shell.

Terminal window
brew install clojure/tools/clojure
brew install borkdude/brew/babashka
brew install direnv

If you are still learning Clojure, you can still use BigConfig to manage your dotfiles without coding.

  1. Create the dotfiles project
    Terminal window
    # Add big-config as tool to Clojure
    clojure -Ttools install-latest :lib io.github.amiorin/big-config :as big-config
    # Invoke the dotfiles template
    clojure -Tbig-config dotfiles
  2. Copy the first
    Terminal window
    cp ~/.gitconfig resources/stage-1/common/dotfiles/.gitconfig
  3. Configure git
    Terminal window
    git init
    git add
    git commit
    git push
Terminal window
# Show dotfiles tasks
bb tasks
# Show dotfiles help
bb help
# Diff your dotfiles
bb diff
# Install your dotfiles
bb install

Getting started with BigConfig for dotfiles doesn’t require knowing Clojure for the basic operations. You can read more about this use case in this blog article .