This repository contains the main configuration for my Linux machines (all Debian). The config components can be categorized along two axes.
- Manual vs. Automatic: Some config is documented in prose and must be done "manually". I try to automate as much as possible, mainly through the use of the a simple dotfiles manager, Nix package manager + home-manager, as well as Ansible.
- Public vs. Private: Most configuration is public, but some configuration I don't want to share and this is kept in a separate private repo.
For automation, three tools are used:
- Very simple dotfile backup utility (built-in)
- Some configuration files. Especially those that are edited via special software, like Autokey. This approach lets me change the config manually and only when I want to commit the changes, I add them explicitly to the repo.
- Nix package manager + home-manager for...
- Some software packages, mainly command-line tools. Nix is very flexible.
- Custom scripts and software. Nix is great for packaging your own scripts and software.
- Some configuration files. Many config files like rc-files etc. are managed by Nix, as it offers a great template mechanism.
- Ansible for...
- Most software packages, especially GUI software. Under the hood therefore Debian's APT is used. The reason for using Ansible and not Nix is that especially GUI software works best on Debian with Debian's APT (I gave in to this realization later than I should have).
Most of the configuration is public in case it is of help to others. Nix and its ecosystem are wonderful tools but there are still many rough edges, so sharing the configuration may help others to get started. I myself benefited a lot from reading other people's resources. I tried to document some lessons learned and other tips, mostly for my future self but if it serves further people, then the better!
The configuration is split into two repos. See more details under "Usage".
- This repo. Contains the public components.
- Private repo. Contains the private components.
How are all components kept separate but are automatically mergable nonetheless?
- Each dotfile is deemed either private or public. It is easy to merge dotfiles from different places.
- Ansible roles are mergable by design.
- Nix hm-modules are mergable by design. Some config files even consist of public and private parts, and are concatenated at build-time (using Nix).
Pick a machine config, e.g. t470p
, and follow the instructions in the corresponding doc file, e.g. ./doc/configs/t470p.md.
Some of these dirs only exist in the private repo.
bin
contains scripts that are used to apply the automatic configurationsdoc
configs
contains machine-specific documentationexplanations
contains explanations of conceptsrecipes.md
contains step-by-step instructionslog.md
: Timestamp-based manually-maintained logarchived.md
: Archived notespast_issues.md
: Documentation of issues encountered in the pasttodos.md
: TODOs
ansible
anything Ansible-relatedplaybooks
contains Ansible configsroles
contains Ansible roles (mergable by design)
nix
anything Nix-relatedhm-configs
contains home-manager configshm-components
contains config componentshm-modules
contains separate home-manager modules
flakes
contains flakes of small toolsglobal-config
is a flake whose only purpose is to pin specific versions of nixpkgs etc.
static
static dotfilescomponents
contains bundles of dotfile paths for re-useconfigs
contains so-called static configurations (= bundles of components)