Files
coder/scripts/update-flake.sh
T
Kyle Carberry 3e3118794f chore: add build targets to nix flake (#13186)
* chore: add build targets to nix flake

Enables `nix build github:coder/coder#main`!

* Fix all packages

* Add back pnpm

* Update flake.nix

Co-authored-by: Asher <ash@coder.com>

* Remove yarn

* fmt

---------

Co-authored-by: Asher <ash@coder.com>
2024-05-06 18:21:20 -04:00

17 lines
394 B
Bash
Executable File

#!/usr/bin/env bash
# Updates SRI hashes for flake.nix.
set -eu
cd "$(dirname "${BASH_SOURCE[0]}")/.."
OUT=$(mktemp -d -t nar-hash-XXXXXX)
echo "Downloading Go modules..."
GOPATH="$OUT" go mod download
echo "Calculating SRI hash..."
HASH=$(go run tailscale.com/cmd/nardump --sri "$OUT/pkg/mod/cache/download")
sudo rm -rf "$OUT"
sed -i "s/\(vendorHash = \"\)[^\"]*/\1${HASH}/" ./flake.nix