2012-01-03 01:51:38 +00:00
|
|
|
with import <nix/config.nix>;
|
|
|
|
|
2012-08-01 20:34:17 +00:00
|
|
|
let
|
|
|
|
|
|
|
|
builder = builtins.toFile "unpack-channel.sh"
|
|
|
|
''
|
|
|
|
mkdir $out
|
|
|
|
cd $out
|
2012-12-05 10:02:44 +00:00
|
|
|
pat="\.xz\$"
|
|
|
|
if [[ "$src" =~ $pat ]]; then
|
|
|
|
${xz} -d < $src | ${tar} xf - ${tarFlags}
|
|
|
|
else
|
|
|
|
${bzip2} -d < $src | ${tar} xf - ${tarFlags}
|
|
|
|
fi
|
2012-08-01 20:34:17 +00:00
|
|
|
mv * $out/$channelName
|
2012-08-01 21:56:11 +00:00
|
|
|
if [ -n "$binaryCacheURL" ]; then
|
|
|
|
mkdir $out/binary-caches
|
|
|
|
echo -n "$binaryCacheURL" > $out/binary-caches/$channelName
|
|
|
|
fi
|
2012-08-01 20:34:17 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2012-08-01 21:56:11 +00:00
|
|
|
{ name, channelName, src, binaryCacheURL ? "" }:
|
2012-01-03 01:51:38 +00:00
|
|
|
|
|
|
|
derivation {
|
2012-04-14 16:38:52 +00:00
|
|
|
system = builtins.currentSystem;
|
2012-01-03 01:51:38 +00:00
|
|
|
builder = shell;
|
2012-08-01 20:34:17 +00:00
|
|
|
args = [ "-e" builder ];
|
2012-08-01 21:56:11 +00:00
|
|
|
inherit name channelName src binaryCacheURL;
|
2012-08-01 20:34:17 +00:00
|
|
|
|
2012-01-03 01:51:38 +00:00
|
|
|
PATH = "${nixBinDir}:${coreutils}";
|
2012-08-01 20:34:17 +00:00
|
|
|
|
2012-04-26 14:52:08 +00:00
|
|
|
# No point in doing this remotely.
|
|
|
|
preferLocalBuild = true;
|
2012-05-10 02:14:36 +00:00
|
|
|
|
|
|
|
# Don't build in a chroot because Nix's dependencies may not be there.
|
|
|
|
__noChroot = true;
|
2012-01-03 01:51:38 +00:00
|
|
|
}
|