oliverdavies.uk/source/_daily_emails/2024-11-29.md
2024-12-02 23:31:43 +00:00

1.6 KiB

title date permalink tags cta snippet
Managing dotfiles with Nix 2024-11-29 daily/2024/11/29/managing-dotfiles-with-nix
software-development
linux
nix
nixos
~ 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 and NixOS as your operating system, 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 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. It includes settings for Git itself, aliases, global excludes, adds extra packages such as git-instafix and some environment variables.

All in one file and all in one language.