about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-10-30T11·33+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-10-30T11·34+0100
commit1f735a34406c1856fd2f6f9a522a06b429c4f799 (patch)
tree0d3495cc6cb753b5b241ceb2d85ff98f831e37ec /src/libstore
parentdae5dc7ade60aa6a9a05e41133da7faebe6bdc1b (diff)
<nix/fetchurl.nix>: Support xz-compressed NARs
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/builtins.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libstore/builtins.cc b/src/libstore/builtins.cc
index fefad63bd1bb..a1c4b48bf62e 100644
--- a/src/libstore/builtins.cc
+++ b/src/libstore/builtins.cc
@@ -2,6 +2,7 @@
 #include "download.hh"
 #include "store-api.hh"
 #include "archive.hh"
+#include "compression.hh"
 
 namespace nix {
 
@@ -28,6 +29,8 @@ void builtinFetchurl(const BasicDerivation & drv)
 
     auto unpack = drv.env.find("unpack");
     if (unpack != drv.env.end() && unpack->second == "1") {
+        if (string(data.data, 0, 6) == string("\xfd" "7zXZ\0", 6))
+            data.data = decompressXZ(data.data);
         StringSource source(data.data);
         restorePath(storePath, source);
     } else