Skip to content

Home Manager Flake

This file is the root of the Home Manager flake.

It defines the entrypoint for the configuration of my personal user environment, including Doom Emacs, fonts, shell settings, and more.

It lives in the hidden .hm directory at the root of the repository, yet I keep it checked in, so I can init the system from it. I add a disclaimer for it though:

# THIS FILE IS AUTOGENERATED. DO NOT EDIT.
# INSTEAD EDIT home_manager_flake.org

We begin by specifying the inputs:

{
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
};

This pulls in the unstable nixpkgs channel, and the home-manager overlay. By making it follow nixpkgs, I ensure that the system and the home environment are built using the same version of the package collection.

We now define the outputs. These include the configuration for the nick user on x86_64-linux:

outputs = { nixpkgs, home-manager, ... }:
let
lib = nixpkgs.lib;
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
in
{

Now we declare the Home Manager configuration itself:

homeConfigurations = {
nick =
home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./emacs/default.nix
./home.nix
];
};
};
};
}

This flake does not output a NixOS system configuration — only the Home Manager environment. This separation is intentional: I keep my system configuration elsewhere.

The list of modules includes:

emacs/default.nix : my Emacs (Doom) environment

home.nix : general user configuration

Together, they define the tools I use daily.

The flake can be activated with:

Terminal window
home-manager switch --flake .hm#nick