aboutsummaryrefslogtreecommitdiff
path: root/corepkgs/unpack-channel.nix
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-03-27 23:40:35 +0100
committerEelco Dolstra <edolstra@gmail.com>2019-11-26 22:07:28 +0100
commit045708db4343174f30f3647776971c852f72a9e8 (patch)
treec37c82882d48e44338c9bae61eacb3839421f359 /corepkgs/unpack-channel.nix
parente60f6bd4ce831ced94fafeb527c429b6f88159ac (diff)
Make <nix/unpack-channel.nix> a builtin builder
This was the last function using a shell script, so this allows us to get rid of tar, coreutils, bash etc.
Diffstat (limited to 'corepkgs/unpack-channel.nix')
-rw-r--r--corepkgs/unpack-channel.nix35
1 files changed, 4 insertions, 31 deletions
diff --git a/corepkgs/unpack-channel.nix b/corepkgs/unpack-channel.nix
index d39a20637..10515bc8b 100644
--- a/corepkgs/unpack-channel.nix
+++ b/corepkgs/unpack-channel.nix
@@ -1,39 +1,12 @@
-with import <nix/config.nix>;
-
-let
-
- builder = builtins.toFile "unpack-channel.sh"
- ''
- mkdir $out
- cd $out
- xzpat="\.xz\$"
- gzpat="\.gz\$"
- if [[ "$src" =~ $xzpat ]]; then
- ${xz} -d < $src | ${tar} xf - ${tarFlags}
- elif [[ "$src" =~ $gzpat ]]; then
- ${gzip} -d < $src | ${tar} xf - ${tarFlags}
- else
- ${bzip2} -d < $src | ${tar} xf - ${tarFlags}
- fi
- if [ * != $channelName ]; then
- mv * $out/$channelName
- fi
- '';
-
-in
-
{ name, channelName, src }:
derivation {
- system = builtins.currentSystem;
- builder = shell;
- args = [ "-e" builder ];
- inherit name channelName src;
+ builder = "builtin:unpack-channel";
+
+ system = "builtin";
- PATH = "${nixBinDir}:${coreutils}";
+ inherit name channelName src;
# No point in doing this remotely.
preferLocalBuild = true;
-
- inherit chrootDeps;
}