nixos-module/pins.nix
jade 491e0f076f Delete npins
This fixes a bug where nixos-rebuild as root cannot build a nixos
configuration since it cannot fetch the sources of our fork of
nix-eval-jobs for lack of ssh key. It doesn't hit cache *in the store*
for lack of `narHash` being specified, which cannot be specified with
npins since npins doesn't output SRI hashes for git inputs.

Altogether a very silly situation. Clearly we just need another pinning
tool.
2024-05-04 17:03:57 -07:00

23 lines
698 B
Nix

# this is a custom pinning tool, written because npins doesn't have narHash
# compatible output for git inputs, and also doesn't support the Nix immutable
# tarball protocol
let
pins = builtins.fromJSON (builtins.readFile ./pins.json);
fetchPin = args@{ kind, ... }:
if kind == "git" then
builtins.fetchGit
{
url = args.url;
ref = args.ref;
rev = args.rev;
narHash = args.nar_hash;
}
else if kind == "tarball" then
builtins.fetchTarball
{
url = args.locked_url;
sha256 = args.nar_hash;
} else builtins.throw "unsupported input type ${kind}";
in
builtins.mapAttrs (_: fetchPin) pins