mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-30 09:36:15 +02:00
bddc83a148
;-) * Channels: fix channels that are plain lists of derivations (like strategoxt-unstable) instead of functions (like nixpkgs-unstable). This fixes the error message "error: the left-hand side of the function call is neither a function nor a primop (built-in operation) but a list".
33 lines
751 B
Bash
33 lines
751 B
Bash
#! @shell@ -e
|
|
|
|
@coreutils@/mkdir $out
|
|
@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]}
|
|
channelTarball=${inputs[n+1]}
|
|
echo "unpacking channel $channelName"
|
|
@bunzip2@ < $channelTarball | @tar@ xf -
|
|
|
|
nr=1
|
|
dirName=$channelName
|
|
while test -e ../$dirName; do
|
|
nr=$((nr+1))
|
|
dirName=$channelName-$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
|