From d51e90c52c17c0d172363dc650ce0a6c6c05ae7d Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sun, 24 Nov 2024 00:45:49 +0000 Subject: [PATCH] Add daily email for 2024-11-21 One configuration language to rule them all --- source/_daily_emails/2024-11-21.md | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 source/_daily_emails/2024-11-21.md diff --git a/source/_daily_emails/2024-11-21.md b/source/_daily_emails/2024-11-21.md new file mode 100644 index 00000000..ac4300be --- /dev/null +++ b/source/_daily_emails/2024-11-21.md @@ -0,0 +1,33 @@ +--- +title: One configuration language to rule them all +date: 2024-11-21 +permalink: daily/2024/11/21/one-configuration-language-to-rule-them-all +tags: + - software-development + - linux + - nix +cta: ~ +snippet: | + No more YAML, TOML, INI or JSON configuration files for me. +--- + +I started using the Nix package manager [in September 2022][0] 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][1] 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. + +[0]: https://github.com/opdavies/dotfiles.nix/commit/af1d8d37 +[1]: https://github.com/opdavies/dotfiles/blob/172b7c9ca61d2dd6ffdc967af9102b1ca24edd81/nix/modules/home-manager/git.nix#L25