From 8ab8d9cb74e75de46e647a5d77c137f7ef3ebd2b Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Mon, 2 Apr 2018 15:02:43 -0400 Subject: [PATCH] Add user channels to the default nix path --- nixos/doc/manual/release-notes/rl-1809.xml | 15 +++++++++++++-- nixos/modules/services/misc/nix-daemon.nix | 4 +++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-1809.xml b/nixos/doc/manual/release-notes/rl-1809.xml index 959bd86759b1..111d6636dd81 100644 --- a/nixos/doc/manual/release-notes/rl-1809.xml +++ b/nixos/doc/manual/release-notes/rl-1809.xml @@ -20,10 +20,21 @@ has the following highlights: - TODO + User channels are now in the default NIX_PATH, + allowing users to use their personal nix-channel + defined channels in nix-build and + nix-shell commands, as well as in imports like + import <mychannel>. + For example + +$ nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgsunstable +$ nix-channel --update +$ nix-build '<nixpkgsunstable>' -A gitFull +$ nix run -f '<nixpkgsunstable>' gitFull +$ nix-instantiate -E '(import <nixpkgsunstable> {}).gitFull' + - diff --git a/nixos/modules/services/misc/nix-daemon.nix b/nixos/modules/services/misc/nix-daemon.nix index ea964fd68e43..d2d29962ce6f 100644 --- a/nixos/modules/services/misc/nix-daemon.nix +++ b/nixos/modules/services/misc/nix-daemon.nix @@ -338,7 +338,9 @@ in nixPath = mkOption { type = types.listOf types.str; default = - [ "nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs" + [ + "$HOME/.nix-defexpr/channels" + "nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs" "nixos-config=/etc/nixos/configuration.nix" "/nix/var/nix/profiles/per-user/root/channels" ];