chore(ci): update to 0.7

This commit is contained in:
arcnmx 2024-02-12 15:08:16 -08:00
parent a0ae2325d6
commit 2f4719811b
6 changed files with 57 additions and 201 deletions

View file

@ -11,10 +11,9 @@ with lib; {
nixpkgs.args.localSystem = "x86_64-linux";
ci = {
version = "v0.6";
version = "v0.7";
gh-actions = {
enable = true;
export = true;
};
};
channels.nixfiles.path = ../.;
@ -25,40 +24,6 @@ with lib; {
#extra-sandbox-paths = with channels.cipkgs; map (package: builtins.unsafeDiscardStringContext "${package}?") [bash qemu "/run/binfmt"];
};
gh-actions = {
jobs = mkIf (config.id != "ci") {
${config.id}.step.architectures = {
order = 201;
name = "prepare for emulated builds";
run = ''
sudo $(which archbinfmt)
'';
};
};
};
environment.bootstrap = {
archbinfmt = let
makeQemuWrapper = name: ''
mkdir -p /run/binfmt
rm -f /run/binfmt/${name}-linux
cat > /run/binfmt/${name}-linux << 'EOF'
#!${channels.cipkgs.bash}/bin/sh
exec -- ${channels.cipkgs.qemu}/bin/qemu-${name} "$@"
EOF
chmod +x /run/binfmt/${name}-linux
'';
in
channels.cipkgs.writeShellScriptBin "archbinfmt" ''
${makeQemuWrapper "aarch64"}
${makeQemuWrapper "arm"}
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-linux:' > /proc/sys/fs/binfmt_misc/register
echo ':armv6l-linux:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\x00\xff\xfe\xff\xff\xff:/run/binfmt/arm-linux:' > /proc/sys/fs/binfmt_misc/register
echo ':armv7l-linux:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\x00\xff\xfe\xff\xff\xff:/run/binfmt/arm-linux:' > /proc/sys/fs/binfmt_misc/register
'';
};
jobs = let
enabledHosts = ["hakurei" "reimu" "aya" "tei" "mediabox" "ct"];
in