From b6ef3ffe08e1c7bdd28f887ca217a65ecd2030a6 Mon Sep 17 00:00:00 2001 From: bri Date: Sun, 11 Feb 2024 03:38:05 -0500 Subject: [PATCH] try building image on cirrus --- .cirrus.yml | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 84 insertions(+), 3 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 07967447c..4eb6b4d37 100755 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -20,6 +20,17 @@ build_template: &BUILD_TEMPLATE install_cachix_script: nix profile install github:nixos/nixpkgs/nixpkgs-unstable#cachix --impure && cachix use $CACHIX_USER flake_check_script: cachix watch-exec $CACHIX_USER -- nix flake check -j auto --system ${ARCH//arm/aarch}-${CIRRUS_OS} --impure --show-trace --accept-flake-config +build_image_template: &BUILD_IMAGE_TEMPLATE + name: build_image_${TARGET}@${ARCH//arm/aarch}-${CIRRUS_OS}_${FORMAT} + only_if: $CIRRUS_BRANCH == $CIRRUS_DEFAULT_BRANCH || $CIRRUS_TAG != "" || $CIRRUS_PR != "" || $CIRRUS_BUILD_SOURCE == "" + timeout_in: 120m + install_cachix_script: nix profile install github:nixos/nixpkgs/nixpkgs-unstable#cachix --impure && cachix use $CACHIX_USER + build_image_script: | + mkdir -p build + cachix watch-exec $CACHIX_USER -- nix build "github:b-/system#nixosConfigurations.${TARGET}@${ARCH//arm/aarch}-${CIRRUS_OS}.config.formats.${FORMAT}" --print-out-paths "build" --show-trace + binaries_artifacts: + path: "build/*" + build_darwin_task: macos_instance: image: $DARWIN_BUILD_IMAGE @@ -33,6 +44,27 @@ build_darwin_task: <<: *BUILD_TEMPLATE build_linux_task: + matrix: + - arm_container: + image: $LINUX_BUILD_IMAGE + cpu: 4 + memory: 16G + env: + ARCH: arm64 + USER: root + - container: + image: $LINUX_BUILD_IMAGE + cpu: 4 + memory: 16G + env: + ARCH: x86_64 + USER: root + configure_flake_script: | + echo "experimental-features = nix-command flakes" | tee -a /etc/nix/nix.conf + echo "$NIX_INSTALLER_EXTRA_CONF" | tee -a /etc/nix/nix.conf + <<: *BUILD_TEMPLATE + +build_image_task: matrix: # - arm_container: # image: $LINUX_BUILD_IMAGE @@ -46,9 +78,58 @@ build_linux_task: cpu: 4 memory: 16G env: - ARCH: x86_64 - USER: root + FORMAT: proxmox + EXT: vma.zst + TARGET: server + - container: + image: $LINUX_BUILD_IMAGE + cpu: 4 + memory: 16G + env: + FORMAT: raw-efi + EXT: img + TARGET: server + - container: + image: $LINUX_BUILD_IMAGE + cpu: 4 + memory: 16G + env: + FORMAT: iso + EXT: iso + TARGET: server + # - container: + # image: $LINUX_BUILD_IMAGE + # cpu: 4 + # memory: 16G + # env: + # FORMAT: proxmox + # EXT: vma.zst + # TARGET: bri + - container: + image: $LINUX_BUILD_IMAGE + cpu: 4 + memory: 16G + env: + FORMAT: proxmox-lxc + EXT: tar.xz + TARGET: server + - container: + image: $LINUX_BUILD_IMAGE + cpu: 4 + memory: 16G + env: + FORMAT: raw-efi + EXT: img + TARGET: bri + - container: + image: $LINUX_BUILD_IMAGE + cpu: 4 + memory: 16G + env: + FORMAT: iso + EXT: iso + TARGET: bri configure_flake_script: | echo "experimental-features = nix-command flakes" | tee -a /etc/nix/nix.conf echo "$NIX_INSTALLER_EXTRA_CONF" | tee -a /etc/nix/nix.conf - <<: *BUILD_TEMPLATE + <<: *BUILD_IMAGE_TEMPLATE