aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/blog/2026-08-15-dotfiles/dotfiles.md88
1 files changed, 88 insertions, 0 deletions
diff --git a/src/blog/2026-08-15-dotfiles/dotfiles.md b/src/blog/2026-08-15-dotfiles/dotfiles.md
new file mode 100644
index 0000000..cdaea19
--- /dev/null
+++ b/src/blog/2026-08-15-dotfiles/dotfiles.md
@@ -0,0 +1,88 @@
1# Dotfiles backup and bootstrap
2
3It took me more than 18 years of using Linux, but I have finally bought
4a used [Thinkpad](https://en.wikipedia.org/wiki/ThinkPad), thus becoming
5a *real* Linux user. To be specific, I got a Thinkpad L13 from ~2020 with
6an Intel i5 CPU and 8Gb of RAM.
7
8After I bought the laptop, it was time to set it up to my likings. I usually
9do this by installing a Linux distro and then manually copying my
10configuration files (a.k.a. *dotfiles*) from some messy backup folder. Since
11I do this quite rarely, and since when I do I also tend to pick a different distro
12just to try it out, I have never bothered automating this process...
13
14...But not anymore! This time I decided to set things up properly.
15
16## OS choice: Alpine Linux
17
18For the operating system, I chose [Alpine Linux](https://alpinelinux.org/).
19It is an extremely simple Linux distribution that relies on minimalistic
20core tools - for example, it uses [busybox](https://busybox.net/) instead of
21[GNU coreutils](https://www.gnu.org/software/coreutils/) and
22[OpenRC](https://en.wikipedia.org/wiki/OpenRC) instead of
23[SystemD](https://en.wikipedia.org/wiki/SystemD). Its package manager is incredibly
24fast (and it can be used [declaratively](../2025-08-16-alpine-declarative)) and
25it's [wiki](https://wiki.alpinelinux.org/wiki/Main_Page) is well-maintained.
26I am liking it a lot, but your mileage may vary - especially because it uses
27[musl](https://musl.libc.org/) as the system C library, breaking compatibility
28with some pre-built applications and, notably, with video streaming platforms
29that rely on [DRM](https://en.wikipedia.org/wiki/Digital_rights_management).
30
31Other options I considered were [Void Linux](https://voidlinux.org),
32that I have happily used since 2020, [OpenBSD](https://www.openbsd.org),
33that I am using on my server and on my old [netbook](../2022-09-10-netbooks),
34[Debian](https://www.debian.org), that I am using on my [gaming
35desktop](../2023-10-15-build-time) and [Slackware](http://www.slackware.com),
36the old time favorite that I used back in 2009-2013. I am not going to explain
37the reasons why I settled on Alpine in the end; it is mostly a matter of
38personal preference anyway.
39
40## Configuration files as a git repository
41
42As for my configuration files, they are now managed via a [git
43repository](https://git.tronto.net/config), as explained in [this blog post
44by Drew De Vault](https://drewdevault.com/blog/dotfiles). In short:
45
46* My home directory is a git repository.
47* All files are ignored by default (my `.gitignore` contains a single line: `*`).
48* Configuration files that I wish to track are manually added with
49 `git add -f my_file`.
50
51This way, the path of each file is preserved in the structure of the
52repository, and cloning it into a new system's `$HOME` makes everything
53fall into place.
54
55There is a small caveat with this setup: every file and directory that is
56directly or indirectly contained in my home, even if `gitignore`'d, is now
57part of this git repository. This includes other git repositories, and this
58could break certain development tools - for example, I had issues with
59[ty](https://docs.astral.sh/ty) ignoring all files due to them being
60`gitignore`'d by my configuration file repository.
61
62While I was at it, I have also moved my [scripts](https://git.tronto.net/scripts)
63into this repository, since they are part of my desktop setup anyway.
64
65## Bootstrapping
66
67Copying configuration files into the right place is not the only thing
68I need to do when I set up a new laptop. I also need to install packages,
69build some software from source (for example, [dwm](https://dwm.suckless.org)),
70edit some configuration files that are outside of `$HOME` (for example,
71in `/etc`), and so on.
72
73I tried to automate these steps as much as I could turned them into [a
74script](https://git.tronto.net/config/file/scripts/setup-config-alpine.html). I
75won't explain everything it does here, you can just read through it if you want -
76it is pretty self-explanatory. This script also takes care of cloning the dotfiles
77repository I mentioned above, so when I set up a new system I just need to download
78a copy of this script from my server and run it.
79
80The script ends by printing some instruction on the remaining manual steps,
81such as uploading my SSH keys into some machines that I regularly
82access remotely and copying copying some secrets into `.ssh`.
83
84## Conclusion
85
86This setup may be a bit overengineered, but it gives me a consistent way to
87quickly set up a new computer, and it also serves as documentation on my local
88configuration.

Generated with cgit - Back to sebastiano.tronto.net