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 %}
[user] email = 32617+amiorin@users.noreply.github.com name = Alberto Miorin[pull] ff = only rebase = true[init] defaultBranch = main[url "https://*************:x-oauth-basic@github.com/"] insteadOf = https://github.com/
[user] email = 32617+amiorin@users.noreply.github.com name = Alberto Miorin[pull] ff = only rebase = true[init] defaultBranch = main
Requirements
Section titled “Requirements”BigConfig requires Clojure and Babashka. You should also configure dirvenv for your shell.
brew install clojure/tools/clojurebrew install borkdude/brew/babashkabrew install direnv
devbox global add clojuredevbox global add babashkadevbox global add direnv
Getting started
Section titled “Getting started”If you are still learning Clojure, you can still use BigConfig to manage your dotfiles without coding.
- Create the dotfiles project
Terminal window # Add big-config as tool to Clojureclojure -Ttools install-latest :lib io.github.amiorin/big-config :as big-config# Invoke the dotfiles templateclojure -Tbig-config dotfiles - Copy the first
Terminal window cp ~/.gitconfig resources/stage-1/common/dotfiles/.gitconfig - Configure git
Terminal window git initgit addgit commitgit push
Common operations
Section titled “Common operations”# Show dotfiles tasksbb tasks# Show dotfiles helpbb help# Diff your dotfilesbb diff# Install your dotfilesbb install
Conclusion
Section titled “Conclusion”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 .