update-scripts: get nixpkgs using flak-compat

This ensures we get an actual nixpkgs flake, which will have source info
like `rev`.

It also means we have access to `nixvim` if we need it.

(cherry picked from commit bfee503e0f)
This commit is contained in:
Matt Sturgeon 2025-05-22 15:40:16 +01:00 committed by github-actions[bot]
parent d14de7a243
commit b04aa8fb49

View file

@ -1,18 +1,8 @@
{ {
# By default, import nixpkgs from flake.lock # By default, load nixvim using flake-compat
pkgs ? nixvim ? import ../.,
let pkgs ? nixvim.inputs.nixpkgs.legacyPackages.${builtins.currentSystem},
lock = (builtins.fromJSON (builtins.readFile ../flake.lock)).nodes.nixpkgs.locked; lib ? nixvim.inputs.nixpkgs.lib,
nixpkgs = fetchTarball {
url =
assert lock.type == "github";
"https://github.com/${lock.owner}/${lock.repo}/archive/${lock.rev}.tar.gz";
sha256 = lock.narHash;
};
in
import nixpkgs { },
lib ? pkgs.lib,
...
}: }:
lib.fix (self: { lib.fix (self: {
# The main script # The main script