aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/default.nix2
-rw-r--r--lib/versions.nix12
2 files changed, 9 insertions, 5 deletions
diff --git a/lib/default.nix b/lib/default.nix
index 18d2dfae1e18..f293a1defb11 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 2c05445b3dd0..0e9d81ac78b1 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.