From 152ae38f5568fbdc6c7824e7afbf15a30258ebf9 Mon Sep 17 00:00:00 2001 From: David Barroso Date: Fri, 26 Jan 2024 16:28:21 +0100 Subject: [PATCH] asd --- Makefile | 8 ++++++-- lib/go/example/flake.lock | 6 +++--- overlays/nhost-cli.nix | 8 ++++++++ overlays/nhost-cli.sh | 12 ++++++++++++ 4 files changed, 29 insertions(+), 5 deletions(-) create mode 100755 overlays/nhost-cli.sh diff --git a/Makefile b/Makefile index f15ca6e..6b357b1 100644 --- a/Makefile +++ b/Makefile @@ -10,16 +10,20 @@ else OS?=linux endif +ifeq ($(CI),true) + build-options=--option system $(ARCH)-linux --extra-platforms ${ARCH}-linux +endif + .PHONY: build build: ## Build application and places the binary under ./result/bin - nix build \ + nix build $(build-options) \ --print-build-logs \ .\#devShells.$(ARCH)-$(OS).default .PHONY: build-dry-run build-dry-run: ## Run nix flake check - nix build \ + nix build $(build-options) \ --dry-run \ --json \ --print-build-logs \ diff --git a/lib/go/example/flake.lock b/lib/go/example/flake.lock index fa2e7d9..ded6263 100644 --- a/lib/go/example/flake.lock +++ b/lib/go/example/flake.lock @@ -41,12 +41,12 @@ }, "locked": { "lastModified": 0, - "narHash": "sha256-SfFzLdA2CQgwVF0BMKVfTP0RlZ6nkWp1sKQWIdOzaqU=", - "path": "/nix/store/xphp9yws1aipy2aw8x4xv9fpn8aibvz3-source", + "narHash": "sha256-kRUgIl71CRlGFwlLJXsgU2oMYL7iA2TFmuo1n0zPcOo=", + "path": "/nix/store/9yz2hy1kr82f6z03krk2095cynz5ikvl-source", "type": "path" }, "original": { - "path": "/nix/store/xphp9yws1aipy2aw8x4xv9fpn8aibvz3-source", + "path": "/nix/store/9yz2hy1kr82f6z03krk2095cynz5ikvl-source", "type": "path" } }, diff --git a/overlays/nhost-cli.nix b/overlays/nhost-cli.nix index 18b57d2..336a87a 100644 --- a/overlays/nhost-cli.nix +++ b/overlays/nhost-cli.nix @@ -6,6 +6,14 @@ let url = "https://github.com/nhost/cli/releases/download/${version}/cli-${version}-darwin-arm64.tar.gz"; sha256 = "0g7zq4qc2jvkj1kd9kd2y1j1hjbpcylg7p8v8v3nhnyvk9li0vgn"; }; + x86_64-darwin = rec { + url = "https://github.com/nhost/cli/releases/download/${version}/cli-${version}-darwin-amd64.tar.gz"; + sha256 = "0kh593iby5sfsdki2g52f3clkcmhaa3jcxiq3b0a47cw89vrnxic"; + }; + aarch64-linux = rec { + url = "https://github.com/nhost/cli/releases/download/${version}/cli-${version}-linux-arm64.tar.gz"; + sha256 = "0nr3wnkl4id4xzzypz9k5l52i221cv91310d2swd4a7ifn39v42q"; + }; x86_64-linux = rec { url = "https://github.com/nhost/cli/releases/download/${version}/cli-${version}-linux-amd64.tar.gz"; sha256 = "13fr478klqbdbkdw3dwv1yhpz57zcj7jr2lp39cvac81187lgrz7"; diff --git a/overlays/nhost-cli.sh b/overlays/nhost-cli.sh new file mode 100755 index 0000000..6188597 --- /dev/null +++ b/overlays/nhost-cli.sh @@ -0,0 +1,12 @@ +#1/usr/bin/env bash + +set -eou pipefail + + +version="$1" +echo "version: $version" + +nix-prefetch-url --type sha256 https://github.com/nhost/cli/releases/download/"$version"/cli-"$version"-darwin-arm64.tar.gz +nix-prefetch-url --type sha256 https://github.com/nhost/cli/releases/download/"$version"/cli-"$version"-darwin-amd64.tar.gz +nix-prefetch-url --type sha256 https://github.com/nhost/cli/releases/download/"$version"/cli-"$version"-linux-arm64.tar.gz +nix-prefetch-url --type sha256 https://github.com/nhost/cli/releases/download/"$version"/cli-"$version"-linux-amd64.tar.gz