mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
lib.version: add release info
This commit is contained in:
parent
211f532644
commit
8f782c7af9
1 changed files with 31 additions and 0 deletions
|
@ -90,4 +90,35 @@ in
|
||||||
locked = lockedInputs.${name}.locked.narHash;
|
locked = lockedInputs.${name}.locked.narHash;
|
||||||
in
|
in
|
||||||
real != locked;
|
real != locked;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Nixvim's current commit, or the specified default when nixvim's repo is dirty.
|
||||||
|
*/
|
||||||
|
revisionWithDefault = default: flake.sourceInfo.rev or default;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Nixvim's current commit, defaulting to the canonical branch name for this release.
|
||||||
|
*/
|
||||||
|
revision = with lib.nixvim.version; revisionWithDefault releaseBranch;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Nixvim's release.
|
||||||
|
|
||||||
|
Derived from the nixpkgs branch targeted in `flake.lock`.
|
||||||
|
*/
|
||||||
|
release =
|
||||||
|
let
|
||||||
|
inherit (lockedInputs.nixpkgs.original) ref;
|
||||||
|
parts = lib.splitString "-" ref;
|
||||||
|
in
|
||||||
|
lib.last parts;
|
||||||
|
|
||||||
|
/**
|
||||||
|
The canonical branch name associated with this release of nixvim.
|
||||||
|
*/
|
||||||
|
releaseBranch =
|
||||||
|
let
|
||||||
|
inherit (lib.nixvim.version) release;
|
||||||
|
in
|
||||||
|
if release == "unstable" then "main" else "nixos-" + release;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue