CI: further attempted fix

This commit is contained in:
kat witch 2021-09-02 06:48:25 +01:00
parent ff5c0846ef
commit 755f7f3806
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
6 changed files with 72 additions and 39 deletions

View file

@ -4,15 +4,20 @@
ci.gh-actions.export = true;
channels.nixfiles.path = ../.;
nix.config.extraPlatforms = "aarch64-linux";
nix.config = {
extra-platforms = "aarch64-linux";
#extra-sandbox-paths = with channels.cipkgs; map (package: builtins.unsafeDiscardStringContext package) [bash qemu "/run/binfmt"];
};
gh-actions = {
jobs.ci.step.aarch64 = {
order = 201;
name = "prepare for aarch64 builds";
run = ''
sudo aarch64binfmt
'';
jobs = mkIf (config.id != "ci") {
${config.id}.step.aarch64 = {
order = 201;
name = "prepare for aarch64 builds";
run = ''
sudo $(which aarch64binfmt)
'';
};
};
};
@ -21,7 +26,7 @@
aarch64binfmt =
let
makeQemuWrapper = name: ''
mkdir -f /run/binfmt
mkdir -p /run/binfmt
rm -f /run/binfmt/${name}
cat > /run/binfmt/${name} << 'EOF'
#!${channels.cipkgs.bash}/bin/sh
@ -31,7 +36,7 @@
''; in
channels.cipkgs.writeShellScriptBin "aarch64binfmt" ''
${makeQemuWrapper "aarch64"}
mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
echo 'extra-sandbox-paths = ${channels.cipkgs.bash} ${channels.cipkgs.qemu} /run/binfmt' >> /etc/nix/nix.conf
echo ':aarch64-linux:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\x00\xff\xfe\xff\xff\xff:/run/binfmt/aarch64:' > /proc/sys/fs/binfmt_misc/register
'';
sourceCache = channels.cipkgs.runCommand "sources"