vps/nix/update-nixpkgs.mjs
Noratrieb f6fb60c03a update does-it-build
now needs a new rust version so let's pull in the rust from 25.11 lol
2025-11-29 00:14:47 +01:00

22 lines
652 B
JavaScript

import fs from "node:fs/promises";
const path = `${import.meta.dirname}/nixpkgs.json`;
const channels = JSON.parse(await fs.readFile(path));
for (const [channel, nixpkgs] of Object.entries(channels)) {
const res = await fetch(
`https://api.github.com/repos/NixOS/nixpkgs/commits/${channel}`
);
if (!res.ok) {
throw new Error(
`get commit for ${channel}: ${res.status} - ${await res.text()}`
);
}
const body = await res.json();
if (body.sha !== nixpkgs.commit) {
nixpkgs.commit = body.sha;
nixpkgs.lastUpdated = new Date().toISOString();
}
}
await fs.writeFile(path, JSON.stringify(channels, null, 2) + "\n");