From 76f1a522fd80af534c84cff0657233a10de323a7 Mon Sep 17 00:00:00 2001 From: davegallant Date: Mon, 13 Sep 2021 01:27:35 +0000 Subject: [PATCH] deploy: 236199a818070468de8f540ac4e8565b416bcd61 --- blog/2021/09/08/why-i-threw-out-my-dotfiles/index.html | 5 ++++- page/search/index.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/blog/2021/09/08/why-i-threw-out-my-dotfiles/index.html b/blog/2021/09/08/why-i-threw-out-my-dotfiles/index.html index 3b6f304b..43ed805f 100644 --- a/blog/2021/09/08/why-i-threw-out-my-dotfiles/index.html +++ b/blog/2021/09/08/why-i-threw-out-my-dotfiles/index.html @@ -269,8 +269,11 @@ nix-shell '<home-manager>' -A ins

If you run zsh, you should see that you have starship and access to several other utils such as rg, fd, and exa.

This basic configuration above is also defining your ~/.config/git/config and .zshrc. If you already have either of these files, home-manager will complain about them already existing.

If you run cat ~/.zshrc, you will see the way these configuration files are generated.

+

You can extend this configuration for programs such as (neo)vim, emacs, alacritty, ssh, etc. To see other programs, take a look at home-manager/modules/programs.

+

Gateway To Nix

+

In ways, home-manager can be seen as a gateway to the nix ecosystem. If you have enjoyed the way you can declare user configuration with home-manager, you may be interested in expanding your configuration to include other system dependencies and configuration. For example, in Linux you can define your entire system’s configuration (including the kernel, kernel modules, networking, filesystems, etc) in nix. For macOS, there is nix-darwin that includes nix modules for configuring launchd, dock, and other preferences and services. You may also want to check out Nix Flakes: a more recent feature that allows you declare dependencies, and have them automatically pinned and hashed in flake.lock, similar to that of many modern package managers.

Wrapping up

-

And that is how you can get started defining your user configuration with home-manager. You can extend this configuration for programs such as (neo)vim, emacs, alacritty, ssh, etc. To see other programs, take a look at home-manager/modules/programs.

+

The title of this post is slightly misleading, since it’s possible to retain some of your dotfiles and have them intermingle with home-manager by including them alongside nix. The idea of defining user configuration using nix can provide a clean way to maintain your configuration, and allow it to be portable across platforms. Is it worth the effort to migrate away from more from shell scripts and dotfiles? I’d say so.