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.
Permalink
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
README.md Update readme Jan 12, 2017
example.nix
nix-build-home
nix-home Fix syntax error Jan 21, 2017

README.md

nix-home

Utilities for working with user configurations in Nix.

commands

nix-home

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

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.

Installation

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) { })
]

Supported

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

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.