about summary refs log tree commit diff
path: root/corepkgs/unpack-channel.nix
diff options
context:
space:
mode:
Diffstat (limited to 'corepkgs/unpack-channel.nix')
-rw-r--r--corepkgs/unpack-channel.nix7
1 files changed, 6 insertions, 1 deletions
diff --git a/corepkgs/unpack-channel.nix b/corepkgs/unpack-channel.nix
index 8cf79f828443..5c2a61e66946 100644
--- a/corepkgs/unpack-channel.nix
+++ b/corepkgs/unpack-channel.nix
@@ -6,7 +6,12 @@ let
     ''
       mkdir $out
       cd $out
-      ${bzip2} -d < $src | ${tar} xf - ${tarFlags}
+      pat="\.xz\$"
+      if [[ "$src" =~ $pat ]]; then
+        ${xz} -d < $src | ${tar} xf - ${tarFlags}
+      else
+        ${bzip2} -d < $src | ${tar} xf - ${tarFlags}
+      fi
       mv * $out/$channelName
       if [ -n "$binaryCacheURL" ]; then
         mkdir $out/binary-caches