doc: remove optional builtins prefixes from prelude functions (#447401)

authored by philiptaron.tngl.sh and committed by GitHub b50da098 c860cbfb

+18 -18
+1 -1
doc/build-helpers/fetchers.chapter.md
··· 3 3 Building software with Nix often requires downloading source code and other files from the internet. 4 4 To this end, we use functions that we call _fetchers_, which obtain remote sources via various protocols and services. 5 5 6 - Nix provides built-in fetchers such as [`builtins.fetchTarball`](https://nixos.org/manual/nix/stable/language/builtins.html#builtins-fetchTarball). 6 + Nix provides built-in fetchers such as [`fetchTarball`](https://nixos.org/manual/nix/stable/language/builtins.html#builtins-fetchTarball). 7 7 Nixpkgs provides its own fetchers, which work differently: 8 8 9 9 - A built-in fetcher will download and cache files at evaluation time and produce a [store path](https://nixos.org/manual/nix/stable/glossary#gloss-store-path).
+3 -3
doc/build-helpers/trivial-build-helpers.chapter.md
··· 163 163 They are useful for creating files from Nix expression, and are all implemented as convenience wrappers around `writeTextFile`. 164 164 165 165 Each of these functions will cause a derivation to be produced. 166 - When you coerce the result of each of these functions to a string with [string interpolation](https://nixos.org/manual/nix/stable/language/string-interpolation) or [`builtins.toString`](https://nixos.org/manual/nix/stable/language/builtins#builtins-toString), it will evaluate to the [store path](https://nixos.org/manual/nix/stable/store/store-path) of this derivation. 166 + When you coerce the result of each of these functions to a string with [string interpolation](https://nixos.org/manual/nix/stable/language/string-interpolation) or [`toString`](https://nixos.org/manual/nix/stable/language/builtins#builtins-toString), it will evaluate to the [store path](https://nixos.org/manual/nix/stable/store/store-path) of this derivation. 167 167 168 168 :::: {.note} 169 169 Some of these functions will put the resulting files within a directory inside the [derivation output](https://nixos.org/manual/nix/stable/language/derivations#attr-outputs). ··· 344 344 `allowSubstitutes` (Bool, _optional_) 345 345 346 346 : Whether to allow substituting from a binary cache. 347 - Passed through to [`allowSubstitutes`](https://nixos.org/manual/nix/stable/language/advanced-attributes#adv-attr-allowSubstitutes) of the underlying call to `builtins.derivation`. 347 + Passed through to [`allowSubstitutes`](https://nixos.org/manual/nix/stable/language/advanced-attributes#adv-attr-allowSubstitutes) of the underlying call to `derivation`. 348 348 349 349 It defaults to `false`, as running the derivation's simple `builder` executable locally is assumed to be faster than network operations. 350 350 Set it to true if the `checkPhase` step is expensive. ··· 355 355 356 356 : Whether to prefer building locally, even if faster [remote build machines](https://nixos.org/manual/nix/stable/command-ref/conf-file#conf-substituters) are available. 357 357 358 - Passed through to [`preferLocalBuild`](https://nixos.org/manual/nix/stable/language/advanced-attributes#adv-attr-preferLocalBuild) of the underlying call to `builtins.derivation`. 358 + Passed through to [`preferLocalBuild`](https://nixos.org/manual/nix/stable/language/advanced-attributes#adv-attr-preferLocalBuild) of the underlying call to `derivation`. 359 359 360 360 It defaults to `true` for the same reason `allowSubstitutes` defaults to `false`. 361 361
+9 -9
doc/doc-support/lib-function-locations.nix
··· 24 24 25 25 libset = 26 26 toplib: 27 - builtins.map (subsetname: { 27 + map (subsetname: { 28 28 subsetname = subsetname; 29 29 functions = libDefPos [ ] toplib.${subsetname}; 30 - }) (builtins.map (x: x.name) libsets); 30 + }) (map (x: x.name) libsets); 31 31 32 32 flattenedLibSubset = 33 33 { subsetname, functions }: 34 - builtins.map (fn: { 34 + map (fn: { 35 35 name = "lib.${subsetname}.${fn.name}"; 36 36 value = fn.location; 37 37 }) functions; 38 38 39 - locatedlibsets = libs: builtins.map flattenedLibSubset (libset libs); 39 + locatedlibsets = libs: map flattenedLibSubset (libset libs); 40 40 removeFilenamePrefix = 41 41 prefix: filename: 42 42 let ··· 46 46 in 47 47 substr; 48 48 49 - removeNixpkgs = removeFilenamePrefix (builtins.toString nixpkgsPath); 49 + removeNixpkgs = removeFilenamePrefix (toString nixpkgsPath); 50 50 51 51 liblocations = builtins.filter (elem: elem.value != null) (lib.lists.flatten (locatedlibsets lib)); 52 52 ··· 59 59 }; 60 60 }; 61 61 62 - relativeLocs = (builtins.map fnLocationRelative liblocations); 62 + relativeLocs = (map fnLocationRelative liblocations); 63 63 sanitizeId = builtins.replaceStrings [ "'" ] [ "-prime" ]; 64 64 65 65 urlPrefix = "https://github.com/NixOS/nixpkgs/blob/${revision}"; 66 66 jsonLocs = builtins.listToAttrs ( 67 - builtins.map ( 67 + map ( 68 68 { name, value }: 69 69 { 70 70 name = sanitizeId name; 71 71 value = 72 72 let 73 - text = "${value.file}:${builtins.toString value.line}"; 74 - target = "${urlPrefix}/${value.file}#L${builtins.toString value.line}"; 73 + text = "${value.file}:${toString value.line}"; 74 + target = "${urlPrefix}/${value.file}#L${toString value.line}"; 75 75 in 76 76 "[${text}](${target}) in `<nixpkgs>`"; 77 77 }
+1 -1
doc/languages-frameworks/dhall.section.md
··· 89 89 # ./example.nix 90 90 91 91 let 92 - nixpkgs = builtins.fetchTarball { 92 + nixpkgs = fetchTarball { 93 93 url = "https://github.com/NixOS/nixpkgs/archive/94b2848559b12a8ed1fe433084686b2a81123c99.tar.gz"; 94 94 hash = "sha256-B4Q3c6IvTLg3Q92qYa8y+i4uTaphtFdjp+Ir3QQjdN0="; 95 95 };
+1 -1
doc/languages-frameworks/javascript.section.md
··· 316 316 `importNpmLock` uses the following fetchers: 317 317 318 318 - `pkgs.fetchurl` for `http(s)` dependencies 319 - - `builtins.fetchGit` for `git` dependencies 319 + - `fetchGit` for `git` dependencies 320 320 321 321 It is possible to provide additional arguments to individual fetchers as needed: 322 322
+3 -3
doc/languages-frameworks/maven.section.md
··· 374 374 pname = "maven-demo"; 375 375 version = "1.0"; 376 376 377 - src = builtins.fetchTarball "https://github.com/fzakaria/nixos-maven-example/archive/main.tar.gz"; 377 + src = fetchTarball "https://github.com/fzakaria/nixos-maven-example/archive/main.tar.gz"; 378 378 buildInputs = [ maven ]; 379 379 380 380 buildPhase = '' ··· 445 445 pname = "maven-demo"; 446 446 version = "1.0"; 447 447 448 - src = builtins.fetchTarball "https://github.com/fzakaria/nixos-maven-example/archive/main.tar.gz"; 448 + src = fetchTarball "https://github.com/fzakaria/nixos-maven-example/archive/main.tar.gz"; 449 449 nativeBuildInputs = [ makeWrapper ]; 450 450 buildInputs = [ maven ]; 451 451 ··· 538 538 pname = "maven-demo"; 539 539 version = "1.0"; 540 540 541 - src = builtins.fetchTarball "https://github.com/fzakaria/nixos-maven-example/archive/main.tar.gz"; 541 + src = fetchTarball "https://github.com/fzakaria/nixos-maven-example/archive/main.tar.gz"; 542 542 nativeBuildInputs = [ makeWrapper ]; 543 543 buildInputs = [ maven ]; 544 544