diff options
author | Joachim Fasting <joachifm@fastmail.fm> | 2019-09-24 10:47:34 +0200 |
---|---|---|
committer | Joachim Fasting <joachifm@fastmail.fm> | 2019-09-26 17:42:42 +0200 |
commit | fd3052901c13af372228502350c444dddc21cb6e (patch) | |
tree | 180755aa3f67f80a55abbe148d2d75964b71749f /lib | |
parent | d484f2b7fc0834a068e8ace851faa449a03963f5 (diff) |
lib/versions: expose splitVersion
Diffstat (limited to 'lib')
-rw-r--r-- | lib/default.nix | 2 | ||||
-rw-r--r-- | lib/versions.nix | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/lib/default.nix b/lib/default.nix index 18d2dfae1e183..f293a1defb11c 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -134,5 +134,7 @@ let mergeAttrsByFuncDefaultsClean mergeAttrBy fakeSha256 fakeSha512 nixType imap; + inherit (versions) + splitVersion; }); in lib diff --git a/lib/versions.nix b/lib/versions.nix index 2c05445b3dd07..0e9d81ac78b1e 100644 --- a/lib/versions.nix +++ b/lib/versions.nix @@ -1,13 +1,15 @@ /* Version string functions. */ { lib }: -let +rec { - splitVersion = builtins.splitVersion or (lib.splitString "."); - -in + /* Break a version string into its component parts. -{ + Example: + splitVersion "1.2.3" + => ["1" "2" "3"] + */ + splitVersion = builtins.splitVersion or (lib.splitString "."); /* Get the major version string from a string. |