Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/build-helpers/fetchers.chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Building software with Nix often requires downloading source code and other files from the internet.
To this end, we use functions that we call _fetchers_, which obtain remote sources via various protocols and services.

Nix provides built-in fetchers such as [`builtins.fetchTarball`](https://nixos.org/manual/nix/stable/language/builtins.html#builtins-fetchTarball).
Nix provides built-in fetchers such as [`fetchTarball`](https://nixos.org/manual/nix/stable/language/builtins.html#builtins-fetchTarball).
Nixpkgs provides its own fetchers, which work differently:

- 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).
Expand Down
6 changes: 3 additions & 3 deletions doc/build-helpers/trivial-build-helpers.chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ Nixpkgs provides the following functions for producing derivations which write t
They are useful for creating files from Nix expression, and are all implemented as convenience wrappers around `writeTextFile`.

Each of these functions will cause a derivation to be produced.
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.
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.

:::: {.note}
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).
Expand Down Expand Up @@ -344,7 +344,7 @@ Write a text file to the Nix store.
`allowSubstitutes` (Bool, _optional_)

: Whether to allow substituting from a binary cache.
Passed through to [`allowSubstitutes`](https://nixos.org/manual/nix/stable/language/advanced-attributes#adv-attr-allowSubstitutes) of the underlying call to `builtins.derivation`.
Passed through to [`allowSubstitutes`](https://nixos.org/manual/nix/stable/language/advanced-attributes#adv-attr-allowSubstitutes) of the underlying call to `derivation`.

It defaults to `false`, as running the derivation's simple `builder` executable locally is assumed to be faster than network operations.
Set it to true if the `checkPhase` step is expensive.
Expand All @@ -355,7 +355,7 @@ Write a text file to the Nix store.

: 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.

Passed through to [`preferLocalBuild`](https://nixos.org/manual/nix/stable/language/advanced-attributes#adv-attr-preferLocalBuild) of the underlying call to `builtins.derivation`.
Passed through to [`preferLocalBuild`](https://nixos.org/manual/nix/stable/language/advanced-attributes#adv-attr-preferLocalBuild) of the underlying call to `derivation`.

It defaults to `true` for the same reason `allowSubstitutes` defaults to `false`.

Expand Down
18 changes: 9 additions & 9 deletions doc/doc-support/lib-function-locations.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ let

libset =
toplib:
builtins.map (subsetname: {
map (subsetname: {
subsetname = subsetname;
functions = libDefPos [ ] toplib.${subsetname};
}) (builtins.map (x: x.name) libsets);
}) (map (x: x.name) libsets);

flattenedLibSubset =
{ subsetname, functions }:
builtins.map (fn: {
map (fn: {
name = "lib.${subsetname}.${fn.name}";
value = fn.location;
}) functions;

locatedlibsets = libs: builtins.map flattenedLibSubset (libset libs);
locatedlibsets = libs: map flattenedLibSubset (libset libs);
removeFilenamePrefix =
prefix: filename:
let
Expand All @@ -46,7 +46,7 @@ let
in
substr;

removeNixpkgs = removeFilenamePrefix (builtins.toString nixpkgsPath);
removeNixpkgs = removeFilenamePrefix (toString nixpkgsPath);

liblocations = builtins.filter (elem: elem.value != null) (lib.lists.flatten (locatedlibsets lib));

Expand All @@ -59,19 +59,19 @@ let
};
};

relativeLocs = (builtins.map fnLocationRelative liblocations);
relativeLocs = (map fnLocationRelative liblocations);
sanitizeId = builtins.replaceStrings [ "'" ] [ "-prime" ];

urlPrefix = "https://github.com/NixOS/nixpkgs/blob/${revision}";
jsonLocs = builtins.listToAttrs (
builtins.map (
map (
{ name, value }:
{
name = sanitizeId name;
value =
let
text = "${value.file}:${builtins.toString value.line}";
target = "${urlPrefix}/${value.file}#L${builtins.toString value.line}";
text = "${value.file}:${toString value.line}";
target = "${urlPrefix}/${value.file}#L${toString value.line}";
in
"[${text}](${target}) in `<nixpkgs>`";
}
Expand Down
2 changes: 1 addition & 1 deletion doc/languages-frameworks/dhall.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ buildDhallPackage {
# ./example.nix

let
nixpkgs = builtins.fetchTarball {
nixpkgs = fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/94b2848559b12a8ed1fe433084686b2a81123c99.tar.gz";
hash = "sha256-B4Q3c6IvTLg3Q92qYa8y+i4uTaphtFdjp+Ir3QQjdN0=";
};
Expand Down
2 changes: 1 addition & 1 deletion doc/languages-frameworks/javascript.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ buildNpmPackage {
`importNpmLock` uses the following fetchers:

- `pkgs.fetchurl` for `http(s)` dependencies
- `builtins.fetchGit` for `git` dependencies
- `fetchGit` for `git` dependencies

It is possible to provide additional arguments to individual fetchers as needed:

Expand Down
6 changes: 3 additions & 3 deletions doc/languages-frameworks/maven.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ stdenv.mkDerivation (finalAttrs: {
pname = "maven-demo";
version = "1.0";

src = builtins.fetchTarball "https://github.com/fzakaria/nixos-maven-example/archive/main.tar.gz";
src = fetchTarball "https://github.com/fzakaria/nixos-maven-example/archive/main.tar.gz";
buildInputs = [ maven ];

buildPhase = ''
Expand Down Expand Up @@ -445,7 +445,7 @@ stdenv.mkDerivation (finalAttrs: {
pname = "maven-demo";
version = "1.0";

src = builtins.fetchTarball "https://github.com/fzakaria/nixos-maven-example/archive/main.tar.gz";
src = fetchTarball "https://github.com/fzakaria/nixos-maven-example/archive/main.tar.gz";
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ maven ];

Expand Down Expand Up @@ -538,7 +538,7 @@ stdenv.mkDerivation (finalAttrs: {
pname = "maven-demo";
version = "1.0";

src = builtins.fetchTarball "https://github.com/fzakaria/nixos-maven-example/archive/main.tar.gz";
src = fetchTarball "https://github.com/fzakaria/nixos-maven-example/archive/main.tar.gz";
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ maven ];

Expand Down
Loading