vendor hash

This commit is contained in:
41666 2025-04-14 20:18:58 -07:00
parent e58e408d8b
commit 1300312318
6 changed files with 18 additions and 4 deletions

3
.gitignore vendored
View file

@ -21,4 +21,5 @@
# Go workspace file
go.work
.direnv/
.direnv/
tmp

View file

@ -1,6 +1,6 @@
{
pkgs ? import <nixpkgs>,
vendorHash ? "sha256-11gXzDYSbLWcOO7W7bx+Zea2mAJvgQkeKVigX5R1aS4=",
vendorHash ? "sha256-eU4m1ZF5MbNpEYMDTbVoORrBzyEzmSlZdmPa6D+tdNg=",
name ? "ps2.live",
}: let
bin = binName: pkgs.buildGoModule {

View file

@ -1,2 +1,5 @@
dev cmd inner_port="8769":
ADDR=":{{inner_port}}" air -build.cmd="go build -o ./tmp/main ./cmd/{{cmd}}" -proxy.app_port="{{inner_port}}"
ADDR=":{{inner_port}}" air -build.cmd="go build -o ./tmp/main ./cmd/{{cmd}}" -proxy.app_port="{{inner_port}}"
update-vendor-hash:
scripts/update-vendor-hash.sh

11
scripts/update-vendor-hash.sh Executable file
View file

@ -0,0 +1,11 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p nix -p coreutils -p gnused -p gawk -p prefetch-npm-deps
set -exuo pipefail
# Go
go mod tidy
failedbuild=$(nix build --impure --expr '(with import <nixpkgs> {}; pkgs.callPackage ./. { vendorHash = ""; }).ps2live' 2>&1 || true)
echo "$failedbuild"
checksum=$(echo "$failedbuild" | awk '/got:.*sha256/ { print $2 }')
sed -i -e "s|vendorHash ? \".*\"|vendorHash ? \"$checksum\"|" default.nix

View file

@ -1 +0,0 @@
exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1exit status 1

BIN
tmp/main

Binary file not shown.