From b04aa8fb491d8f842f6f81c2fea433f87fe9a91c Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Thu, 22 May 2025 15:40:16 +0100 Subject: [PATCH] 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 bfee503e0fac061bd8e5958e22ea76d4a1a64758) --- update-scripts/default.nix | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/update-scripts/default.nix b/update-scripts/default.nix index 35985b76..eb9e0cb2 100644 --- a/update-scripts/default.nix +++ b/update-scripts/default.nix @@ -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