lib.version: add correctNixpkgsChannel

This commit is contained in:
Matt Sturgeon 2025-05-20 23:30:22 +01:00
parent 8f782c7af9
commit ebd4ba4f79
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -121,4 +121,20 @@ in
inherit (lib.nixvim.version) release;
in
if release == "unstable" then "main" else "nixos-" + release;
/**
Whether the nixpkgs input is correct for this release of nixvim.
Can be used to identify mismatched nixpkgs inputs, usually caused our input
following a user's input from another channel
*/
correctNixpkgsChannel =
let
nixvimRelease = lib.nixvim.version.release;
nixpkgsRelease = lib.trivial.release;
in
if nixvimRelease == "unstable" then
true # TODO: how do we know what channel a nixpkgs instance is on?
else
nixvimRelease == nixpkgsRelease;
}