From 4d0223c9931306cdf2cac91c5b6ca277702643b3 Mon Sep 17 00:00:00 2001 From: Nicolas Guilloux Date: Mon, 21 Oct 2024 16:09:59 +0200 Subject: [PATCH] Try building for aarch64 --- .github/workflows/artifact.yaml | 48 ++++++++++++++++++++++++++++----- configuration.nix | 2 +- flake.lock | 2 +- flake.nix | 2 +- nspawn-tarball.nix | 2 +- 5 files changed, 45 insertions(+), 11 deletions(-) diff --git a/.github/workflows/artifact.yaml b/.github/workflows/artifact.yaml index 5a91899..aa93ef6 100644 --- a/.github/workflows/artifact.yaml +++ b/.github/workflows/artifact.yaml @@ -5,14 +5,48 @@ on: pull_request: jobs: - check: + # check: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v3 + + # - name: Install Nix + # uses: DeterminateSystems/nix-installer-action@main + + # - name: Setup caches + # uses: DeterminateSystems/magic-nix-cache-action@main + + # - name: Building tarball + # run: nix build + + # - name: Uploading artifacts + # uses: actions/upload-artifact@v3 + # with: + # name: nixos-system-x86_64-linux.tar.xz + # path: result/tarball/nixos-system-x86_64-linux.tar.xz + + build: runs-on: ubuntu-latest + strategy: + matrix: + arch: ['x86_64', 'aarch64'] steps: - uses: actions/checkout@v3 - - uses: DeterminateSystems/nix-installer-action@main - - uses: DeterminateSystems/magic-nix-cache-action@main - - run: nix build - - uses: actions/upload-artifact@v3 + - run: sudo apt-get install -y qemu-user-static + + - uses: cachix/install-nix-action@v21 + with: + extra_nix_config: | + system = ${{ matrix.arch }}-linux + + - name: Building tarball for ${{ matrix.arch }} + run: nix build + + - name: Test + run: ls ./result/tarball/* + + - name: Uploading artifacts + uses: actions/upload-artifact@v3 with: - name: nixos-system-x86_64-linux.tar.xz - path: result/tarball/nixos-system-x86_64-linux.tar.xz + name: nixos-system-${{ matrix.arch }}-linux.tar.xz + path: result/tarball/nixos-system-${{ matrix.arch }}-linux.tar.xz \ No newline at end of file diff --git a/configuration.nix b/configuration.nix index 439af68..7ab96de 100644 --- a/configuration.nix +++ b/configuration.nix @@ -20,7 +20,7 @@ wget ]; - system.stateVersion = "23.11"; + system.stateVersion = "24.05"; # Set an initial password here or at runtime do `machinectl shell nixos` and # run `passwd` there. diff --git a/flake.lock b/flake.lock index 0952bee..b23b1d2 100644 --- a/flake.lock +++ b/flake.lock @@ -29,7 +29,7 @@ }, "original": { "owner": "nixos", - "ref": "nixos-23.11", + "ref": "nixos-24.05", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index e8a1569..b718623 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,7 @@ inputs = { flake-parts.url = "github:hercules-ci/flake-parts"; - nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; treefmt-nix.inputs.nixpkgs.follows = "nixpkgs"; treefmt-nix.url = "github:numtide/treefmt-nix"; }; diff --git a/nspawn-tarball.nix b/nspawn-tarball.nix index 3d58a17..0db5fbd 100644 --- a/nspawn-tarball.nix +++ b/nspawn-tarball.nix @@ -5,7 +5,7 @@ let flakeFile = builtins.toFile "flake.nix" '' { - inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; + inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; outputs = inputs@{ self, nixpkgs, ...}: { nixosConfigurations.${config.system.name} = nixpkgs.lib.nixosSystem {