From 0bea4a50e035c06805ac65360b1b50d3681e4f87 Mon Sep 17 00:00:00 2001 From: Domen Kožar Date: Thu, 8 Nov 2018 12:03:50 +0000 Subject: Deprecate builtins.toPath --- doc/manual/expressions/builtins.xml | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) (limited to 'doc/manual/expressions') diff --git a/doc/manual/expressions/builtins.xml b/doc/manual/expressions/builtins.xml index 873f30b062ee..3f396ac1d991 100644 --- a/doc/manual/expressions/builtins.xml +++ b/doc/manual/expressions/builtins.xml @@ -1027,22 +1027,8 @@ Evaluates to [ "foo" ]. path Return true if the path - path exists, and - false otherwise. One application of this - function is to conditionally include a Nix expression containing - user configuration: - - -let - fileName = builtins.getEnv "CONFIG_FILE"; - config = - if fileName != "" && builtins.pathExists (builtins.toPath fileName) - then import (builtins.toPath fileName) - else { someSetting = false; }; # default configuration -in config.someSetting - - (Note that CONFIG_FILE must be an absolute path for - this to work.) + path exists at evaluation time, and + false otherwise. @@ -1344,13 +1330,10 @@ in foo builtins.toPath s - Convert the string value - s into a path value. The string - s must represent an absolute path - (i.e., must start with /). The path need not - exist. The resulting path is canonicalised, e.g., - builtins.toPath "//foo/xyzzy/../bar/" returns - /foo/bar. + DEPRECATED. Use /. + "/path" + to convert a string into an absolute path. For relative paths, + use ./. + "/path". + -- cgit 1.4.1