Enable ISO ARM cross-compilation & update CI config
- Allow rune to cross compile ARM binaries - Github workflow only compiles x86 for now
This commit is contained in:
parent
d9eaddc9db
commit
dc35d4335f
3 changed files with 19 additions and 32 deletions
38
.github/workflows/build-iso.yml
vendored
38
.github/workflows/build-iso.yml
vendored
|
@ -1,4 +1,4 @@
|
|||
name: Build NixOS ISOs
|
||||
name: Build NixOS ISOs (x86 only)
|
||||
|
||||
on:
|
||||
push:
|
||||
|
@ -16,23 +16,10 @@ jobs:
|
|||
build-iso:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
# x86 ISOs on x86 runners
|
||||
- iso-type: server
|
||||
arch: x86
|
||||
runner: ubuntu-latest
|
||||
- iso-type: desktop
|
||||
arch: x86
|
||||
runner: ubuntu-latest
|
||||
# ARM ISOs on ARM runners
|
||||
- iso-type: server
|
||||
arch: arm
|
||||
runner: ubuntu-latest-arm64
|
||||
- iso-type: desktop
|
||||
arch: arm
|
||||
runner: ubuntu-latest-arm64
|
||||
iso-type: [server, desktop]
|
||||
arch: [x86]
|
||||
|
||||
runs-on: ${{ matrix.runner }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
|
@ -47,12 +34,12 @@ jobs:
|
|||
- name: Build ISO (with retry)
|
||||
uses: nick-fields/retry@v3
|
||||
with:
|
||||
timeout_minutes: 60
|
||||
timeout_minutes: 45
|
||||
max_attempts: 3
|
||||
retry_wait_seconds: 30
|
||||
command: |
|
||||
cd iso
|
||||
nix build .#${{ matrix.iso-type }}-iso-${{ matrix.arch }} \
|
||||
nix build .#${{ matrix.iso-type }}-iso-x86 \
|
||||
--print-build-logs \
|
||||
--accept-flake-config
|
||||
|
||||
|
@ -60,7 +47,7 @@ jobs:
|
|||
id: iso-info
|
||||
run: |
|
||||
cd iso
|
||||
ISO_PATH=$(nix build .#${{ matrix.iso-type }}-iso-${{ matrix.arch }} --print-out-paths --no-link)
|
||||
ISO_PATH=$(nix build .#${{ matrix.iso-type }}-iso-x86 --print-out-paths --no-link)
|
||||
ISO_FILE=$(find $ISO_PATH -name "*.iso" -o -name "*.iso.zst" | head -1)
|
||||
ISO_NAME=$(basename "$ISO_FILE")
|
||||
echo "iso-path=$ISO_FILE" >> $GITHUB_OUTPUT
|
||||
|
@ -96,10 +83,9 @@ jobs:
|
|||
This release contains automatically built NixOS ISOs based on my configuration.
|
||||
|
||||
### Available ISOs:
|
||||
- **Server ISOs**: Minimal server environment with SSH access
|
||||
- **Desktop ISOs**: GNOME desktop environment for installation
|
||||
- **x86**: Intel/AMD 64-bit systems
|
||||
- **ARM**: ARM64 systems
|
||||
- **Server ISO**: Minimal server environment with SSH access
|
||||
- **Desktop ISO**: GNOME desktop environment for installation
|
||||
- **Architecture**: x86_64 (Intel/AMD systems)
|
||||
|
||||
### Usage:
|
||||
1. Download the appropriate ISO for your system
|
||||
|
@ -107,6 +93,8 @@ jobs:
|
|||
3. Default credentials: user `nixos`, password `nixos`
|
||||
4. SSH is enabled for remote installation
|
||||
|
||||
Note: ARM ISOs are not provided in this build. Users requiring ARM versions should build locally.
|
||||
|
||||
Built automatically from commit: ${{ github.sha }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
prerelease: false
|
|
@ -7,15 +7,17 @@
|
|||
system,
|
||||
...
|
||||
}:
|
||||
let
|
||||
isCross = pkgs.stdenv.buildPlatform.system != pkgs.stdenv.hostPlatform.system;
|
||||
in
|
||||
{
|
||||
## ISO ##
|
||||
isoImage = {
|
||||
isoName = lib.mkForce "nixos-${config.hostSpec.hostName}-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.iso";
|
||||
makeEfiBootable = true;
|
||||
makeUsbBootable = true;
|
||||
compressImage = false;
|
||||
squashfsCompression = lib.mkIf isARM "gzip";
|
||||
includeSystemBuildDependencies = lib.mkIf isARM false;
|
||||
includeSystemBuildDependencies = lib.mkIf (isARM || isCross) false;
|
||||
};
|
||||
|
||||
## SSH & NETWORK ##
|
||||
|
@ -56,7 +58,6 @@
|
|||
system.stateVersion = "25.05";
|
||||
nixpkgs.hostPlatform = system;
|
||||
users.mutableUsers = lib.mkForce true; # Allow password changes
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
nixpkgs.config = {
|
||||
allowUnsupportedSystem = true;
|
||||
|
|
|
@ -87,7 +87,7 @@
|
|||
}) configs
|
||||
);
|
||||
|
||||
# Generate packages per system - each system only exposes its own packages
|
||||
# Generate packages per system - all available on x86_64 via cross-compilation
|
||||
mkPackages =
|
||||
system:
|
||||
let
|
||||
|
@ -103,13 +103,11 @@
|
|||
{
|
||||
nixosConfigurations = mkConfigurations;
|
||||
|
||||
# Each system only exposes packages it can build
|
||||
packages = {
|
||||
"${X86}" = mkPackages X86;
|
||||
"${X86}" = (mkPackages X86) // (mkPackages ARM);
|
||||
"${ARM}" = mkPackages ARM;
|
||||
};
|
||||
|
||||
# For convenience - all systems get all configs
|
||||
inherit (dot-nix.outputs) overlays;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue