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.
This commit is contained in:
Matt Sturgeon 2025-05-22 15:40:16 +01:00
parent e385bec735
commit bfee503e0f
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -1,18 +1,8 @@
{
# By default, import nixpkgs from flake.lock
pkgs ?
let
lock = (builtins.fromJSON (builtins.readFile ../flake.lock)).nodes.nixpkgs.locked;
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,
...
# By default, load nixvim using flake-compat
nixvim ? import ../.,
pkgs ? nixvim.inputs.nixpkgs.legacyPackages.${builtins.currentSystem},
lib ? nixvim.inputs.nixpkgs.lib,
}:
lib.fix (self: {
# The main script