mirror of
https://github.com/NixOS/nix
synced 2025-07-16 02:01:59 +02:00
-----BEGIN PGP SIGNATURE----- iQFHBAABCAAxFiEEtUHVUwEnDgvPFcpdgXC0cm1xmN4FAmfheacTHGVkb2xzdHJh QGdtYWlsLmNvbQAKCRCBcLRybXGY3kt2B/4tQvs6iDXA12d409ClHbVQjr1d0FLP rv8RxZ7Z4+Jaw8r2ra/I+gpr9juI5ULyEJWqfES72hTvbYPjH1Grsrrjak1tx57E +STs21oEPojE8LXsFH1oZamGPPIIpyQdxCvTgZs1N6cqUfCRQ3Jx97X6E6SIGJDR VqBM4ruSXCY57yT36HqwYydTkxzZHiNP5wwABGfSb7u9pYW5x3r8W7+fQ3udTnCw kCRhA5vnfxIQSlxu4j7dJqSCGzOIPnhYB19bXDV4aPhl4sn3pkBCdMZxPBlCWSwx it0ngMITf+TeiMpVl2TtvMBOHtlGrbhusbyKcsqzFYULGyGOC9ngTAY3 =/JzB -----END PGP SIGNATURE----- Merge tag '2.27.1' into detsys-main Tagging release 2.27.1
42 lines
1.1 KiB
Nix
42 lines
1.1 KiB
Nix
{
|
|
lib,
|
|
runCommand,
|
|
nix,
|
|
tarballs,
|
|
}:
|
|
|
|
runCommand "installer-script"
|
|
{
|
|
buildInputs = [ nix ];
|
|
}
|
|
''
|
|
mkdir -p $out/nix-support
|
|
|
|
# Converts /nix/store/50p3qk8k...-nix-2.4pre20201102_550e11f/bin/nix to 50p3qk8k.../bin/nix.
|
|
tarballPath() {
|
|
# Remove the store prefix
|
|
local path=''${1#${builtins.storeDir}/}
|
|
# Get the path relative to the derivation root
|
|
local rest=''${path#*/}
|
|
# Get the derivation hash
|
|
local drvHash=''${path%%-*}
|
|
echo "$drvHash/$rest"
|
|
}
|
|
|
|
substitute ${./install.in} $out/install \
|
|
${
|
|
lib.concatMapStrings (
|
|
tarball:
|
|
let
|
|
inherit (tarball.stdenv.hostPlatform) system;
|
|
in
|
|
''
|
|
\
|
|
--replace '@tarballHash_${system}@' $(nix hash-file --base16 --type sha256 ${tarball}/*.tar.xz) \
|
|
--replace '@tarballPath_${system}@' $(tarballPath ${tarball}/*.tar.xz) \
|
|
''
|
|
) tarballs
|
|
} --replace '@nixVersion@' ${nix.version}
|
|
|
|
echo "file installer $out/install" >> $out/nix-support/hydra-build-products
|
|
''
|