From 7437f01ab39179119683a8b1cd5a777856c0e544 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 2 Dec 2024 23:26:18 +0000 Subject: [PATCH] Add daily email for 2024-11-29 Managing dotfiles with Nix --- source/_daily_emails/2024-11-29.md | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 source/_daily_emails/2024-11-29.md diff --git a/source/_daily_emails/2024-11-29.md b/source/_daily_emails/2024-11-29.md new file mode 100644 index 00000000..e6940a1d --- /dev/null +++ b/source/_daily_emails/2024-11-29.md @@ -0,0 +1,35 @@ +--- +title: Managing dotfiles with Nix +date: 2024-11-29 +permalink: daily/2024/11/29/managing-dotfiles-with-nix +tags: + - software-development + - linux + - nix + - nixos +cta: ~ +snippet: | + I use Nix and Home Manager to manage my dotfiles and configure the programs I use, and it works on NixOS and standalone. +--- + +[As well as Nix managing packages][0] and [NixOS as your operating system][1], you can use Nix to manage your user configuration and dotfiles. + +Enter, Home Manager. + +Home Manager is available as a module for NixOS and a standalone package for other Linux distributions and macOS. + +With it, you can install and configure programs for specific users and create and manage dotfiles such as .gitconfig, .tmux.conf and .zshrc instead of using a tool like Stow. + +There's also the extra benefit that [you can write these files in the Nix language][2] and only focus on one configuration language. + +Nix and Home Manager will create the desired output file in whatever the program wants, whether it's JSON, ini, YAML or something else. + +A good example is [my .gitconfig configuration][3]. It includes settings for Git itself, aliases, global excludes, adds extra packages such as [git-instafix][4] and some environment variables. + +All in one file and all in one language. + +[0]: {{site.url}}/daily/2024/11/25/nix-the-package-manager +[1]: {{site.url}}/daily/2024/11/27/nix-as-an-operating-system +[2]: {{site.url}}/daily/2024/11/21/one-configuration-language-to-rule-them-all +[3]: https://github.com/opdavies/dotfiles/blob/3acd73f6a2e19eadcc16baf22afad5dfad5e049b/nix/modules/home-manager/features/cli/git.nix +[4]: https://zet.oliverdavies.uk/notes/10