Hacker News new | ask | show | jobs
by hiimshort 874 days ago
Declarative home environments are pretty great. Being able to reproduce your entire user setup is fantastic when you manage multiple machines or want to make future migrations.

I run NixOS and use Home-Manager as well. This lets me define my entire system in addition to my user home contents declaratively. So with this configuration I can apply NixOS & Home-Manager to get the same results anywhere.

Here is an example of my Home-Manager configuration: https://github.com/jakehamilton/config/blob/a3da20eeab74a50a...

In this example I configure Git. This gets written to my user home's config directory.

1 comments

Where the "home config" in this case can be much more than just text files and, for example, can include the actual apps installed locally. So when you define your `.git/config` file, you can include `diff.external = ${pkgs.difft}` to refer to a locally installed version of app `difft` and home-manager does the right thing. You can also manage your user services through systemd or launchd.
The stuff Nix lets you declare really are very arbitrary. I even specify my Firefox extensions in my home-manager config.