aboutsummaryrefslogtreecommitdiff
path: root/nix-support
diff options
context:
space:
mode:
authorQyriad <qyriad@qyriad.me>2024-04-12 06:35:54 -0600
committerQyriad <qyriad@qyriad.me>2024-04-12 06:35:54 -0600
commit629351163dd20ecc40e4b69366c283f8da9b2972 (patch)
treeb15def0336e3a027983b0e70ddeb845710f23833 /nix-support
parent99845e0e01eaa2120b10c22591c43c4305f5ba51 (diff)
flake: factor out binary tarball into its own file
Bit-for-bit identical, and this one is callPackage-able Change-Id: Ic635687b0054e107271a9c24ae69101f5e0fba9e
Diffstat (limited to 'nix-support')
-rw-r--r--nix-support/binary-tarball.nix28
1 files changed, 28 insertions, 0 deletions
diff --git a/nix-support/binary-tarball.nix b/nix-support/binary-tarball.nix
new file mode 100644
index 000000000..88c556c33
--- /dev/null
+++ b/nix-support/binary-tarball.nix
@@ -0,0 +1,28 @@
+{
+ buildPackages,
+ nix,
+ system,
+ version,
+}:
+let
+ installerClosureInfo = buildPackages.closureInfo { rootPaths = [ nix ]; };
+
+ meta.description = "Distribution-independent Nix bootstrap binaries for ${system}";
+in
+buildPackages.runCommand "nix-binary-tarball-${version}" { inherit meta; } ''
+ cp ${installerClosureInfo}/registration $TMPDIR/reginfo
+
+ dir=nix-${version}-${system}
+ fn=$out/$dir.tar.xz
+ mkdir -p $out/nix-support
+ echo "file binary-dist $fn" >> $out/nix-support/hydra-build-products
+ tar cvfJ $fn \
+ --owner=0 --group=0 --mode=u+rw,uga+r \
+ --mtime='1970-01-01' \
+ --absolute-names \
+ --hard-dereference \
+ --transform "s,$TMPDIR/reginfo,$dir/.reginfo," \
+ --transform "s,$NIX_STORE,$dir/store,S" \
+ $TMPDIR/reginfo \
+ $(cat ${installerClosureInfo}/store-paths)
+''