forked from lix-project/lix
flake.nix: installScriptFor
take tarballs not strings
Trying to look up keys in multiple places is not nice, better for the caller to be explicit.
This commit is contained in:
parent
0b81557e2c
commit
f60c2e8a5a
32
flake.nix
32
flake.nix
|
@ -256,7 +256,7 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
installScriptFor = systems:
|
installScriptFor = tarballs:
|
||||||
with nixpkgsFor.x86_64-linux.native;
|
with nixpkgsFor.x86_64-linux.native;
|
||||||
runCommand "installer-script"
|
runCommand "installer-script"
|
||||||
{ buildInputs = [ nix ];
|
{ buildInputs = [ nix ];
|
||||||
|
@ -277,14 +277,14 @@
|
||||||
|
|
||||||
substitute ${./scripts/install.in} $out/install \
|
substitute ${./scripts/install.in} $out/install \
|
||||||
${pkgs.lib.concatMapStrings
|
${pkgs.lib.concatMapStrings
|
||||||
(system: let
|
(tarball: let
|
||||||
tarball = if builtins.elem system crossSystems then self.hydraJobs.binaryTarballCross.x86_64-linux.${system} else self.hydraJobs.binaryTarball.${system};
|
inherit (tarball.stdenv.hostPlatform) system;
|
||||||
in '' \
|
in '' \
|
||||||
--replace '@tarballHash_${system}@' $(nix --experimental-features nix-command hash-file --base16 --type sha256 ${tarball}/*.tar.xz) \
|
--replace '@tarballHash_${system}@' $(nix --experimental-features nix-command hash-file --base16 --type sha256 ${tarball}/*.tar.xz) \
|
||||||
--replace '@tarballPath_${system}@' $(tarballPath ${tarball}/*.tar.xz) \
|
--replace '@tarballPath_${system}@' $(tarballPath ${tarball}/*.tar.xz) \
|
||||||
''
|
''
|
||||||
)
|
)
|
||||||
systems
|
tarballs
|
||||||
} --replace '@nixVersion@' ${version}
|
} --replace '@nixVersion@' ${version}
|
||||||
|
|
||||||
echo "file installer $out/install" >> $out/nix-support/hydra-build-products
|
echo "file installer $out/install" >> $out/nix-support/hydra-build-products
|
||||||
|
@ -341,7 +341,7 @@
|
||||||
installerClosureInfo = buildPackages.closureInfo { rootPaths = [ nix cacert ]; };
|
installerClosureInfo = buildPackages.closureInfo { rootPaths = [ nix cacert ]; };
|
||||||
in
|
in
|
||||||
|
|
||||||
buildPackages.runCommand "nix-binary-tarball-${version}"
|
pkgs.runCommand "nix-binary-tarball-${version}"
|
||||||
{ #nativeBuildInputs = lib.optional (system != "aarch64-linux") shellcheck;
|
{ #nativeBuildInputs = lib.optional (system != "aarch64-linux") shellcheck;
|
||||||
meta.description = "Distribution-independent Nix bootstrap binaries for ${pkgs.system}";
|
meta.description = "Distribution-independent Nix bootstrap binaries for ${pkgs.system}";
|
||||||
}
|
}
|
||||||
|
@ -579,22 +579,22 @@
|
||||||
# installation script.
|
# installation script.
|
||||||
installerScript = installScriptFor [
|
installerScript = installScriptFor [
|
||||||
# Native
|
# Native
|
||||||
"x86_64-linux"
|
self.hydraJobs.binaryTarball."x86_64-linux"
|
||||||
"i686-linux"
|
self.hydraJobs.binaryTarball."i686-linux"
|
||||||
"aarch64-linux"
|
self.hydraJobs.binaryTarball."aarch64-linux"
|
||||||
"x86_64-darwin"
|
self.hydraJobs.binaryTarball."x86_64-darwin"
|
||||||
"aarch64-darwin"
|
self.hydraJobs.binaryTarball."aarch64-darwin"
|
||||||
# Cross
|
# Cross
|
||||||
"armv6l-linux"
|
self.hydraJobs.binaryTarballCross."x86_64-linux"."armv6l-linux"
|
||||||
"armv7l-linux"
|
self.hydraJobs.binaryTarballCross."x86_64-linux"."armv7l-linux"
|
||||||
];
|
];
|
||||||
installerScriptForGHA = installScriptFor [
|
installerScriptForGHA = installScriptFor [
|
||||||
# Native
|
# Native
|
||||||
"x86_64-linux"
|
self.hydraJobs.binaryTarball."x86_64-linux"
|
||||||
"x86_64-darwin"
|
self.hydraJobs.binaryTarball."x86_64-darwin"
|
||||||
# Cross
|
# Cross
|
||||||
"armv6l-linux"
|
self.hydraJobs.binaryTarballCross."x86_64-linux"."armv6l-linux"
|
||||||
"armv7l-linux"
|
self.hydraJobs.binaryTarballCross."x86_64-linux"."armv7l-linux"
|
||||||
];
|
];
|
||||||
|
|
||||||
# docker image with Nix inside
|
# docker image with Nix inside
|
||||||
|
|
Loading…
Reference in a new issue