Skip to content
Utilities for working with user configurations in Nix.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib Fix errors when contents of a file contains UTF-8 chars. Jun 10, 2017
COPYING Update readme Jan 12, 2017
nix-home Fix syntax error Jan 21, 2017


Utilities for working with user configurations in Nix.



The command delegates to nix-env, so it supports any parameter that nix-env does.

Running nix-home by itself builds and symlinks the files defined in $HOME/default.nix

NOTE: nix-home --dry-run will still attempt to link. This is a bug! #15


nix-build-home builds $HOME/default.nix via nix-build and prints out the derivation. Useful for testing your config without linking to your home directory. Does NOT generate a ./result symlink.


The package for installing nix-home is on the wiki here. Include it in your configuration.nix file via:

environment.systemPackages = [
  ((pkgs.callPackage path/to/nixhome/package.nix) { })


nix-home, when invoked, builds ~/default.nix, which must define a derivation.

nix-home calls nix-env to build a profile from the derivation. The derivation is an overlay that gets linked into your home directory.

There is a helper function in nixhome called mkHome, for making the derivation:

with import <nixpkgs> {};
with import <nixhome> { inherit stdenv; inherit pkgs; };
mkHome {
  user = "username";
  files = {
	 ".screenrc" = ./path-to-file;
	 ".vimrc" = "${somePkg}/path-to-file";
	 ".bashrc".content = ''
		... bashrc conents


Generations are supported via standard nix-env parameters:

* nix-home --list-generations
* nix-home --rollback
* nix-home --switch-generation 1
* nix-home --delete-generations 1 2 3
You can’t perform that action at this time.