diff options
Diffstat (limited to 'lib/strings.nix')
-rw-r--r-- | lib/strings.nix | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/strings.nix b/lib/strings.nix index bac03c9d7ad9d..e72bdc6d968c2 100644 --- a/lib/strings.nix +++ b/lib/strings.nix @@ -218,4 +218,9 @@ rec { # Format a number adding leading zeroes up to fixed width. fixedWidthNumber = width: n: fixedWidthString width "0" (toString n); + + + # Check whether a value is a store path. + isStorePath = x: builtins.substring 0 1 (toString x) == "/" && dirOf (builtins.toPath x) == builtins.storeDir; + } |