summary refs log tree commit diff
path: root/nixos/modules/programs/environment.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2015-04-12 23:50:20 +0200
committeraszlig <aszlig@redmoonstudios.org>2015-04-12 23:50:20 +0200
commit65e569cc37a52dd6476469df1e53e669acfaf508 (patch)
treed339b2be706f8ac9388c67796f69da1e15bb88a0 /nixos/modules/programs/environment.nix
parentcebf5894625d41eb7332ee69fdd798f407093ba5 (diff)
downloadnixpkgs-65e569cc37a52dd6476469df1e53e669acfaf508.tar
nixpkgs-65e569cc37a52dd6476469df1e53e669acfaf508.tar.gz
nixpkgs-65e569cc37a52dd6476469df1e53e669acfaf508.tar.bz2
nixpkgs-65e569cc37a52dd6476469df1e53e669acfaf508.tar.lz
nixpkgs-65e569cc37a52dd6476469df1e53e669acfaf508.tar.xz
nixpkgs-65e569cc37a52dd6476469df1e53e669acfaf508.tar.zst
nixpkgs-65e569cc37a52dd6476469df1e53e669acfaf508.zip
nixos: Add all of root's channels to NIX_PATH.
This is very useful if you want to distribute channels (and thus
expressions as well) in a similar fashion to Debians APT sources (or
PPAs or whatnot).

So, for example if you have a channel with some additional functions
or packages, you simply add that channel with:

sudo nix-channel --add https://example.com/my-nifty-channel foo

And you can access that channel using <foo>, for example in your
configuration.nix:

{
  imports = [ <foo/modules/shiny-little-module> ];
  environment.systemPackages = with import <foo/pkgs> {}; [ bar blah ];
  services.udev.extraRules = import <foo/lib/udev/mkrule.nix> {
    kernel = "eth*";
    attr.address = "00:1D:60:B9:6D:4F";
    name = "my_fast_network_card";
  };
}

Within nixpkgs, we shouldn't have <nixos> used anywhere anymore, so we
shouldn't get into conflicts.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'nixos/modules/programs/environment.nix')
-rw-r--r--nixos/modules/programs/environment.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/nixos/modules/programs/environment.nix b/nixos/modules/programs/environment.nix
index e0379a2c02a..1a211b8c84f 100644
--- a/nixos/modules/programs/environment.nix
+++ b/nixos/modules/programs/environment.nix
@@ -25,7 +25,8 @@ in
 
     environment.sessionVariables =
       { NIX_PATH =
-          [ "/nix/var/nix/profiles/per-user/root/channels/nixos"
+          [ "/nix/var/nix/profiles/per-user/root/channels"
+            "/nix/var/nix/profiles/per-user/root/channels/nixos"
             "nixpkgs=/etc/nixos/nixpkgs"
             "nixos-config=/etc/nixos/configuration.nix"
           ];