2012-01-03 03:51:38 +02:00
|
|
|
with import <nix/config.nix>;
|
|
|
|
|
2012-08-01 23:34:17 +03:00
|
|
|
let
|
|
|
|
|
|
|
|
builder = builtins.toFile "unpack-channel.sh"
|
|
|
|
''
|
|
|
|
mkdir $out
|
|
|
|
cd $out
|
2013-05-14 16:10:14 +03:00
|
|
|
xzpat="\.xz\$"
|
|
|
|
gzpat="\.gz\$"
|
|
|
|
if [[ "$src" =~ $xzpat ]]; then
|
2012-12-05 12:02:44 +02:00
|
|
|
${xz} -d < $src | ${tar} xf - ${tarFlags}
|
2013-07-12 15:06:05 +03:00
|
|
|
elif [[ "$src" =~ $gzpat ]]; then
|
2013-05-14 16:10:14 +03:00
|
|
|
${gzip} -d < $src | ${tar} xf - ${tarFlags}
|
2012-12-05 12:02:44 +02:00
|
|
|
else
|
|
|
|
${bzip2} -d < $src | ${tar} xf - ${tarFlags}
|
|
|
|
fi
|
2017-02-27 11:09:48 +02:00
|
|
|
if [ * != $channelName ]; then
|
|
|
|
mv * $out/$channelName
|
|
|
|
fi
|
2012-08-01 23:34:17 +03:00
|
|
|
'';
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2019-06-25 14:27:16 +03:00
|
|
|
{ name, channelName, src }:
|
2012-01-03 03:51:38 +02:00
|
|
|
|
|
|
|
derivation {
|
2012-04-14 19:38:52 +03:00
|
|
|
system = builtins.currentSystem;
|
2012-01-03 03:51:38 +02:00
|
|
|
builder = shell;
|
2012-08-01 23:34:17 +03:00
|
|
|
args = [ "-e" builder ];
|
2019-06-25 14:27:16 +03:00
|
|
|
inherit name channelName src;
|
2012-08-01 23:34:17 +03:00
|
|
|
|
2012-01-03 03:51:38 +02:00
|
|
|
PATH = "${nixBinDir}:${coreutils}";
|
2012-08-01 23:34:17 +03:00
|
|
|
|
2012-04-26 17:52:08 +03:00
|
|
|
# No point in doing this remotely.
|
|
|
|
preferLocalBuild = true;
|
2012-05-10 05:14:36 +03:00
|
|
|
|
2015-03-24 12:15:45 +02:00
|
|
|
inherit chrootDeps;
|
2012-01-03 03:51:38 +02:00
|
|
|
}
|