feat(nix): auto-update pnpmDeps hash (#490)

This commit is contained in:
Weathercold
2025-08-29 01:08:58 +08:00
committed by GitHub
parent 8b0c18028f
commit 525964ba27
5 changed files with 46 additions and 6 deletions
@@ -0,0 +1,30 @@
name: Update Nix pnpmDeps Hash
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'pnpm-lock.yaml'
permissions:
contents: write
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
with:
extra_nix_config: experimental-features = nix-command flakes
- name: Update Hash
run: nix/update-pnpm-deps-hash.sh
- uses: stefanzweifel/git-auto-commit-action@v6
with:
commit_message: 'chore(nix): update pnpmDeps hash'
commit_author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
+3 -3
View File
@@ -23,14 +23,14 @@
packages = forAllSystems (system: {
default = self.packages.${system}.airi;
airi = (pkgsForSystem system).callPackage ./package.nix { };
airi-debug = (pkgsForSystem system).callPackage ./package.nix { debugBuild = true; };
airi = (pkgsForSystem system).callPackage ./nix/package.nix { };
airi-debug = (pkgsForSystem system).callPackage ./nix/package.nix { debugBuild = true; };
});
overlays = {
default = self.overlays.airi;
airi = final: _: {
airi = final.callPackage ./package.nix { };
airi = final.callPackage ./nix/package.nix { };
};
};
+3 -3
View File
@@ -29,17 +29,17 @@ rustPlatform.buildRustPackage (final: {
pname = "airi";
version = "0.7.2-beta.2";
src = ./.;
src = ../.;
cargoLock = {
lockFile = ./Cargo.lock;
lockFile = ../Cargo.lock;
outputHashes."rdev-0.6.0" = "sha256-mGt44/kVo5EJO1Wf6MPLq0sZgwGTzuQjeVT6HxVzpQY=";
};
pnpmDeps = pnpm.fetchDeps {
inherit (final) pname version src;
fetcherVersion = 1;
hash = "sha256-y28rG+9NADUdwdjIAkYCqmYOKLoEWosAOpiGM4JPQoQ="; # To update, set it to ""
hash = builtins.readFile ./pnpm-deps-hash.txt;
};
# Cache of assets downloaded during vite build
+1
View File
@@ -0,0 +1 @@
sha256-NOtKBXFu/eIVcCNjsizlF3t/6f+izx3cRdU7HbjW0cM=
+9
View File
@@ -0,0 +1,9 @@
#! /usr/bin/env bash
set -eux
ROOT="$(dirname "$(readlink -f "$0")")"
:> "$ROOT/pnpm-deps-hash.txt" # Clear hash
HASH=$(nix build "$ROOT/..#airi.pnpmDeps" |& grep -oP 'got: +\K\S+')
echo -n $HASH > "$ROOT/pnpm-deps-hash.txt"