From 8226f71c349be248f251656a6316c09bbb794557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 19 Jul 2022 13:34:10 +0200 Subject: build-turris.sh: rework cross-compile --- build-turris.sh | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'build-turris.sh') diff --git a/build-turris.sh b/build-turris.sh index bb9ebe6..860dbad 100755 --- a/build-turris.sh +++ b/build-turris.sh @@ -1,18 +1,23 @@ -#!/bin/sh -omnia_hash="17b62c338f2a0862a58bb6951556beecd98ccda9" -moxes=( "spt-mox2" ) -omnias=( "spt-omnia" ) +#!/usr/bin/env bash +set -eu +omnia_hash="bd7ac5d8c08538ec1f126d34b765f0362427fe17" +routers=( "spt-mox2" "spt-omnia" ) cd "${0%/*}" || exit -for system in "${moxes[@]}"; do - echo "Building $system" - nix build -o "result-${system}" ".#nixosConfigurations.${system}.config.system.build.toplevel" -done -for system in "${omnias[@]}"; do +for system in "${routers[@]}"; do echo "Building $system" + declare -a args + toplevel=".config.system.build.toplevel" + if [[ "$system" == *omnia ]]; then + toplevel=".config.system.build.cross.x86_64-linux${toplevel}" + args=( \ + "--override-input" "nixpkgs" "github:NixOS/nixpkgs/${omnia_hash}" + "--override-input" "nixturris/nixpkgs" "github:NixOS/nixpkgs/${omnia_hash}" + "--override-input" "nixturris" "/home/cynerd/projects/nixturris" + ) + fi nix build \ - --override-input nixpkgs "github:NixOS/nixpkgs/${omnia_hash}" \ - --override-input nixturris/nixpkgs "github:NixOS/nixpkgs/${omnia_hash}" \ -o "result-${system}" \ - ".#nixosConfigurations.${system}.config.system.build.toplevel" + "${args[@]}" \ + ".#nixosConfigurations.${system}${toplevel}" done -- cgit v1.2.3