From f0c875d646260d03168b4ecc93ebccfdf84b4350 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Tue, 28 Jul 2020 18:25:48 -0400 Subject: [PATCH] Add a way to build the UEFI iso --- build-iso.sh | 16 ++++++++++++++++ iso.nix | 12 ++++++++++++ 2 files changed, 28 insertions(+) create mode 100755 build-iso.sh create mode 100644 iso.nix diff --git a/build-iso.sh b/build-iso.sh new file mode 100755 index 0000000..e679ec4 --- /dev/null +++ b/build-iso.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -e +set -u +PS4=" $ " + +# Ugh, I would have liked to do it through a simpler `nix-build`, but as this +# needs to set `NIX_PATH` for use of `` imports, this is the better +# way to go. + +set -x +exec env -i \ + NIXPKGS_ALLOW_UNFREE=1 \ + NIX_PATH="nixpkgs=channel:nixos-unstable" \ + "$(command -v nix-build)" \ + iso.nix -A config.system.build.isoImage "$@" diff --git a/iso.nix b/iso.nix new file mode 100644 index 0000000..dc2861e --- /dev/null +++ b/iso.nix @@ -0,0 +1,12 @@ +import { + configuration = { + imports = [ + ( + if builtins.currentSystem == "aarch64-linux" + then builtins.toPath (./. + "/configuration.nix") + else builtins.toPath (./. + "/with-cross.nix") + ) + + ]; + }; + }