oliverdavies.uk/source/_daily_emails/2024-11-21.md
Oliver Davies d51e90c52c Add daily email for 2024-11-21
One configuration language to rule them all
2024-11-24 01:00:38 +00:00

1.5 KiB

title date permalink tags cta snippet
One configuration language to rule them all 2024-11-21 daily/2024/11/21/one-configuration-language-to-rule-them-all
software-development
linux
nix
~ No more YAML, TOML, INI or JSON configuration files for me.

I started using the Nix package manager in September 2022 as a replacement for Ansible.

Since then, I've switched to daily-driving NixOS as my main operating system and Home Manager to manage my dotfiles (configuration files for managing application settings, like Neovim, tmux and Alacritty).

A benefit I didn't initially think of was that now I can write all my configuration files in the Nix language.

I don't need to write YAML, TOML, INI or JSON configuration files. Nix and Home Manager will convert it for me.

For example, see my Git configuration written in Nix which is converted and written to .gitignore.

And, if there isn't a built-in module for what I need, there are functions like toJSON that will convert Nix code to JSON that I can write to a file.

This is also great if a program changes its configuration file language, which Alacritty did recently.

They changed from YAML to TOML and I didn't need to change anything.

Nix has become my one configuration language to rule them all.