export the nix-cache worker as a package

This commit is contained in:
Abel Luck 2026-02-26 13:58:46 +01:00
parent 8501f0ac3a
commit ea675c8818

View file

@ -11,6 +11,22 @@
forAllSystems = fn: nixpkgs.lib.genAttrs systems (system: fn nixpkgs.legacyPackages.${system});
in
{
packages = forAllSystems (pkgs: {
nix-cache = pkgs.buildNpmPackage {
pname = "nix-cache";
version = "0.1.0";
src = ./nix-cache;
npmDepsHash = "sha256-bIujU7pZa1ExCZOMOoxsTeLDSF1GuPN/oMSgiMhY/04=";
buildPhase = ''
npx wrangler deploy --dry-run --outdir dist
'';
installPhase = ''
mkdir -p $out
cp dist/index.js $out/
'';
};
});
checks = forAllSystems (pkgs: {
nix-cache-tests = pkgs.buildNpmPackage {
pname = "nix-cache-tests";