Loading lib/path/default.nix +150 −146 Original line number Diff line number Diff line Loading @@ -121,7 +121,8 @@ let in /* No rec! Add dependencies on this file at the top. */ { /* Append a subpath string to a path. /* Append a subpath string to a path. Like `path + ("/" + string)` but safer, because it errors instead of returning potentially surprising results. More specifically, it checks that the first argument is a [path value type](https://nixos.org/manual/nix/stable/language/values.html#type-path"), Loading Loading @@ -317,7 +318,8 @@ in /* No rec! Add dependencies on this file at the top. */ { subpath = joinRelPath deconstructed.components; }; /* Whether a value is a valid subpath string. /* Whether a value is a valid subpath string. A subpath string points to a specific file or directory within an absolute base directory. It is a stricter form of a relative path that excludes `..` components, since those could escape the base directory. Loading Loading @@ -364,7 +366,8 @@ in /* No rec! Add dependencies on this file at the top. */ { subpathInvalidReason value == null; /* Join subpath strings together using `/`, returning a normalised subpath string. /* Join subpath strings together using `/`, returning a normalised subpath string. Like `concatStringsSep "/"` but safer, specifically: Loading Loading @@ -469,7 +472,8 @@ in /* No rec! Add dependencies on this file at the top. */ { ${subpathInvalidReason subpath}''; splitRelPath subpath; /* Normalise a subpath. Throw an error if the subpath isn't [valid](#function-library-lib.path.subpath.isValid). /* Normalise a subpath. Throw an error if the subpath isn't [valid](#function-library-lib.path.subpath.isValid). - Limit repeating `/` to a single one. Loading Loading
lib/path/default.nix +150 −146 Original line number Diff line number Diff line Loading @@ -121,7 +121,8 @@ let in /* No rec! Add dependencies on this file at the top. */ { /* Append a subpath string to a path. /* Append a subpath string to a path. Like `path + ("/" + string)` but safer, because it errors instead of returning potentially surprising results. More specifically, it checks that the first argument is a [path value type](https://nixos.org/manual/nix/stable/language/values.html#type-path"), Loading Loading @@ -317,7 +318,8 @@ in /* No rec! Add dependencies on this file at the top. */ { subpath = joinRelPath deconstructed.components; }; /* Whether a value is a valid subpath string. /* Whether a value is a valid subpath string. A subpath string points to a specific file or directory within an absolute base directory. It is a stricter form of a relative path that excludes `..` components, since those could escape the base directory. Loading Loading @@ -364,7 +366,8 @@ in /* No rec! Add dependencies on this file at the top. */ { subpathInvalidReason value == null; /* Join subpath strings together using `/`, returning a normalised subpath string. /* Join subpath strings together using `/`, returning a normalised subpath string. Like `concatStringsSep "/"` but safer, specifically: Loading Loading @@ -469,7 +472,8 @@ in /* No rec! Add dependencies on this file at the top. */ { ${subpathInvalidReason subpath}''; splitRelPath subpath; /* Normalise a subpath. Throw an error if the subpath isn't [valid](#function-library-lib.path.subpath.isValid). /* Normalise a subpath. Throw an error if the subpath isn't [valid](#function-library-lib.path.subpath.isValid). - Limit repeating `/` to a single one. Loading