about summary refs log tree commit diff
path: root/corepkgs
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2007-09-17T16·08+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2007-09-17T16·08+0000
commit055608227f5a003825a905b0eb2aea39cba5ca16 (patch)
treefd3f4a9e9e6dd0df64e208b74f84ac7d79a67808 /corepkgs
parent3339f854473863c8780e537626f457be0b2b33e2 (diff)
* nix-env: allow ~/.nix-defexpr to be a directory. If it is, then the
  Nix expressions in that directory are combined into an attribute set
  {file1 = import file1; file2 = import file2; ...}, i.e. each Nix
  expression is an attribute with the file name as the attribute
  name.  Also recurses into directories.

* nix-env: removed the "--import" (-I) option which set the
  ~/.nix-defexpr symlink.

* nix-channel: don't use "nix-env --import", instead symlink
  ~/.nix-defexpr/channels.  So finally nix-channel --update doesn't
  override any default Nix expressions but combines with them.

  This means that you can have (say) a local Nixpkgs SVN tree and use
  it as a default for nix-env:

  $ ln -s .../path-to-nixpkgs-tree ~/.nix-defexpr/nixpkgs_svn

  and be subscribed to channels (including Nixpkgs) at the same time.
  (If there is any ambiguity, the -A flag can be used to
  disambiguate, e.g. "nix-env -i -A nixpkgs_svn.pan".)

Diffstat (limited to 'corepkgs')
-rw-r--r--corepkgs/channels/unpack.sh.in13
1 files changed, 3 insertions, 10 deletions
diff --git a/corepkgs/channels/unpack.sh.in b/corepkgs/channels/unpack.sh.in
index 1f2886a6ab4f..1be4a39a1d9c 100644
--- a/corepkgs/channels/unpack.sh.in
+++ b/corepkgs/channels/unpack.sh.in
@@ -4,9 +4,6 @@
 @coreutils@/mkdir $out/tmp
 cd $out/tmp
 
-expr=$out/default.nix
-echo '{' > $expr
-
 inputs=($inputs)
 for ((n = 0; n < ${#inputs[*]}; n += 2)); do
     channelName=${inputs[n]}
@@ -15,19 +12,15 @@ for ((n = 0; n < ${#inputs[*]}; n += 2)); do
     @bunzip2@ < $channelTarball | @tar@ xf -
 
     nr=1
-    dirName=$channelName
+    attrName=$(echo $channelName | @tr@ -- '- ' '__')
+    dirName=$attrName
     while test -e ../$dirName; do
         nr=$((nr+1))
-        dirName=$channelName-$nr
+        dirName=$attrName-$nr
     done
 
     @coreutils@/mv * ../$dirName # !!! hacky
-    
-    attrName=$(echo $dirName | @tr@ -- '- ' '__')
-    echo "$attrName = let e = import ./$dirName; in if builtins.isFunction e then e {} else e;" >> $expr
 done
 
-echo '} // {_combineChannels = true;}' >> $expr
-
 cd ..
 @coreutils@/rmdir tmp