Add aarch64 support
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
d08f067665
commit
87327a573a
7 changed files with 30 additions and 8 deletions
14
.github/workflows/nix.yml
vendored
14
.github/workflows/nix.yml
vendored
|
@ -18,11 +18,23 @@ jobs:
|
|||
- nixos-unstable
|
||||
- nixos-23.05
|
||||
- nixos-23.11
|
||||
system:
|
||||
- x86_64-linux
|
||||
- aarch64-linux
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: cachix/install-nix-action@v25
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
with:
|
||||
platforms: arm64
|
||||
- uses: DeterminateSystems/nix-installer-action@main
|
||||
with:
|
||||
extra-conf: |
|
||||
extra-platforms = aarch64-linux
|
||||
|
||||
- run: nix-shell --run ./ci.sh
|
||||
env:
|
||||
CI_REGISTRY_AUTH: '${{ secrets.REGISTRY_AUTH }}'
|
||||
NIXPKGS_CHANNEL: '${{ matrix.channel }}'
|
||||
NIX_SYSTEM_NAME: '${{ matrix.system }}'
|
||||
|
|
2
ci.sh
2
ci.sh
|
@ -8,6 +8,7 @@ channel=${NIXPKGS_CHANNEL:-nixos-unstable}
|
|||
registry=${CI_REGISTRY:-docker.io}
|
||||
registry_auth=${CI_REGISTRY_AUTH:-}
|
||||
image_prefix=${CI_PROJECT_PATH:-nixpkgs}
|
||||
system_name=${NIX_SYSTEM_NAME:-x86_64-linux}
|
||||
|
||||
if [[ $channel == nixos-unstable ]]; then
|
||||
image_tag=latest
|
||||
|
@ -30,6 +31,7 @@ banner "Building images"
|
|||
nix-build \
|
||||
--no-out-link \
|
||||
--option sandbox true \
|
||||
--argstr system "$system_name"
|
||||
|
||||
if [[ $(git rev-parse --abbrev-ref HEAD) != master ]]; then
|
||||
banner "Skipping push on non-master branch"
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
let
|
||||
pkgs = import ./pkgs.nix;
|
||||
{
|
||||
system ? builtins.currentSystem
|
||||
}: let
|
||||
pkgs = import ./pkgs.nix system;
|
||||
in
|
||||
pkgs.docker-nixpkgs
|
||||
|
|
|
@ -8,9 +8,10 @@ set -euo pipefail
|
|||
|
||||
user=$1
|
||||
org=${2:-nixpkgs}
|
||||
system_name=${NIX_SYSTEM_NAME:-x86_64-linux}
|
||||
|
||||
nix_eval() {
|
||||
nix-instantiate --strict --eval --json "$@"
|
||||
nix-instantiate --strict --eval --argstr system "$system_name" --json "$@"
|
||||
}
|
||||
|
||||
releases_json=$(nix_eval)
|
||||
|
|
6
pkgs.nix
6
pkgs.nix
|
@ -1,7 +1,9 @@
|
|||
import <nixpkgs> {
|
||||
system:
|
||||
# docker images run on Linux
|
||||
system = "x86_64-linux";
|
||||
assert builtins.elem system ["x86_64-linux" "aarch64-linux"];
|
||||
import <nixpkgs> {
|
||||
config = { };
|
||||
inherit system;
|
||||
overlays = [
|
||||
(import ./overlay.nix)
|
||||
];
|
||||
|
|
3
push-all
3
push-all
|
@ -6,8 +6,9 @@ set -euo pipefail
|
|||
registry=${1:-docker.io}
|
||||
image_prefix=${2:-nixpkgs}
|
||||
image_tag=${3:-latest}
|
||||
system_name=${NIX_SYSTEM_NAME:-x86_64-linux}
|
||||
|
||||
releases_json=$(nix-instantiate --strict --eval --json)
|
||||
releases_json=$(nix-instantiate --strict --argstr system "$system_name" --eval --json)
|
||||
|
||||
echo "=== Pushing images to $registry"
|
||||
|
||||
|
|
|
@ -3,9 +3,11 @@
|
|||
# Usage: ./dockerhub-image-matrix
|
||||
set -euo pipefail
|
||||
|
||||
system_name=${NIX_SYSTEM_NAME:-x86_64-linux}
|
||||
|
||||
## Main ##
|
||||
|
||||
releases_json=$(nix-instantiate --strict --eval --json)
|
||||
releases_json=$(nix-instantiate --strict --argstr system "$system_name" --eval --json)
|
||||
|
||||
echo "| Image / Tag | Pull |"
|
||||
echo "| --- | --- |"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue