Skip to content

Commit

Permalink
treewide: nixos.org/manual/nix -> nix.dev/manual/nix
Browse files Browse the repository at this point in the history
The move happened here: NixOS/nix.dev#764

This is necessary because some redirects broke during the move.

Command used to get this result:
```
grep -rlF 'https://nixos.org/manual/nix/' ./ | xargs -I@ sed -i -e 's/https:\/\/nixos.org\/manual\/nix\/stable/https:\/\/nix.dev\/manual\/nix\/latest/g' @
```

For reviewers, here is a good way to ensure the updated links function:
```
nix-shell -p lychee --run "lychee doc/ --exclude '.*' --include 'https://nix.dev'"
```
  • Loading branch information
tomodachi94 committed Aug 17, 2024
1 parent f3834d1 commit 0abbbd2
Show file tree
Hide file tree
Showing 43 changed files with 104 additions and 104 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ For new packages please briefly describe the package or provide a link to its ho
- [ ] aarch64-linux
- [ ] x86_64-darwin
- [ ] aarch64-darwin
- For non-Linux: Is sandboxing enabled in `nix.conf`? (See [Nix manual](https://nixos.org/manual/nix/stable/command-ref/conf-file.html))
- For non-Linux: Is sandboxing enabled in `nix.conf`? (See [Nix manual](https://nix.dev/manual/nix/latest/command-ref/conf-file.html))
- [ ] `sandbox = relaxed`
- [ ] `sandbox = true`
- [ ] Tested, as applicable:
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ This section describes in some detail how changes can be made and proposed with

To avoid having to download and build potentially many derivations, at the expense of using a potentially outdated version, you can base the branch off a specific [Git commit](https://www.git-scm.com/docs/gitglossary#def_commit) instead:
- The commit of the latest `nixpkgs-unstable` channel, available [here](https://channels.nixos.org/nixpkgs-unstable/git-revision).
- The commit of a local Nixpkgs downloaded using [nix-channel](https://nixos.org/manual/nix/stable/command-ref/nix-channel), available using `nix-instantiate --eval --expr '(import <nixpkgs/lib>).trivial.revisionWithDefault null'`
- The commit of a local Nixpkgs downloaded using [nix-channel](https://nix.dev/manual/nix/latest/command-ref/nix-channel), available using `nix-instantiate --eval --expr '(import <nixpkgs/lib>).trivial.revisionWithDefault null'`
- If you're using NixOS, the commit of your NixOS installation, available with `nixos-version --revision`.

Once you have an appropriate commit you can use it instead of `upstream/master` in the above command:
Expand Down Expand Up @@ -132,7 +132,7 @@ When a PR is created, it will be pre-populated with some checkboxes detailed bel
When sandbox builds are enabled, Nix will set up an isolated environment for each build process.
It is used to remove further hidden dependencies set by the build environment to improve reproducibility.
This includes access to the network during the build outside of `fetch*` functions and files outside the Nix store.
Depending on the operating system, access to other resources is blocked as well (e.g., inter-process communication is isolated on Linux); see [sandbox](https://nixos.org/manual/nix/stable/command-ref/conf-file#conf-sandbox) in the Nix manual for details.
Depending on the operating system, access to other resources is blocked as well (e.g., inter-process communication is isolated on Linux); see [sandbox](https://nix.dev/manual/nix/latest/command-ref/conf-file#conf-sandbox) in the Nix manual for details.
In pull requests for [nixpkgs](https://github.com/NixOS/nixpkgs/) people are asked to test builds with sandboxing enabled (see `Tested using sandboxing` in the pull request template) because in [Hydra](https://nixos.org/hydra/) sandboxing is also used.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ system, [Hydra](https://hydra.nixos.org/).
Artifacts successfully built with Hydra are published to cache at
https://cache.nixos.org/. When successful build and test criteria are
met, the Nixpkgs expressions are distributed via [Nix
channels](https://nixos.org/manual/nix/stable/package-management/channels.html).
channels](https://nix.dev/manual/nix/latest/package-management/channels.html).

# Contributing

Expand Down
2 changes: 1 addition & 1 deletion doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ You, as the writer of documentation, are still in charge of its content.
:::
```

- Use [definition lists](#definition-lists) to document function arguments, and the attributes of such arguments as well as their [types](https://nixos.org/manual/nix/stable/language/values).
- Use [definition lists](#definition-lists) to document function arguments, and the attributes of such arguments as well as their [types](https://nix.dev/manual/nix/latest/language/values).
For example:

```markdown
Expand Down
2 changes: 1 addition & 1 deletion doc/build-helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
A build helper is a function that produces derivations.

:::{.warning}
This is not to be confused with the [`builder` argument of the Nix `derivation` primitive](https://nixos.org/manual/nix/unstable/language/derivations.html), which refers to the executable that produces the build result, or [remote builder](https://nixos.org/manual/nix/stable/advanced-topics/distributed-builds.html), which refers to a remote machine that could run such an executable.
This is not to be confused with the [`builder` argument of the Nix `derivation` primitive](https://nixos.org/manual/nix/unstable/language/derivations.html), which refers to the executable that produces the build result, or [remote builder](https://nix.dev/manual/nix/latest/advanced-topics/distributed-builds.html), which refers to a remote machine that could run such an executable.
:::

Such a function is usually designed to abstract over a typical workflow for a given programming language or framework.
Expand Down
38 changes: 19 additions & 19 deletions doc/build-helpers/fetchers.chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
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 [`builtins.fetchTarball`](https://nix.dev/manual/nix/latest/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).
A Nixpkgs fetcher will create a ([fixed-output](https://nixos.org/manual/nix/stable/glossary#gloss-fixed-output-derivation)) [derivation](https://nixos.org/manual/nix/stable/glossary#gloss-derivation), and files are downloaded at build time.
- Built-in fetchers will invalidate their cache after [`tarball-ttl`](https://nixos.org/manual/nix/stable/command-ref/conf-file#conf-tarball-ttl) expires, and will require network activity to check if the cache entry is up to date.
- A built-in fetcher will download and cache files at evaluation time and produce a [store path](https://nix.dev/manual/nix/latest/glossary#gloss-store-path).
A Nixpkgs fetcher will create a ([fixed-output](https://nix.dev/manual/nix/latest/glossary#gloss-fixed-output-derivation)) [derivation](https://nix.dev/manual/nix/latest/glossary#gloss-derivation), and files are downloaded at build time.
- Built-in fetchers will invalidate their cache after [`tarball-ttl`](https://nix.dev/manual/nix/latest/command-ref/conf-file#conf-tarball-ttl) expires, and will require network activity to check if the cache entry is up to date.
Nixpkgs fetchers only re-download if the specified hash changes or the store object is not available.
- Built-in fetchers do not use [substituters](https://nixos.org/manual/nix/stable/command-ref/conf-file#conf-substituters).
- Built-in fetchers do not use [substituters](https://nix.dev/manual/nix/latest/command-ref/conf-file#conf-substituters).
Derivations produced by Nixpkgs fetchers will use any configured binary cache transparently.

This significantly reduces the time needed to evaluate Nixpkgs, and allows [Hydra](https://nixos.org/hydra) to retain and re-distribute sources used by Nixpkgs in the [public binary cache](https://cache.nixos.org).
Expand All @@ -30,7 +30,7 @@ The following table summarises the differences:

## Caveats {#chap-pkgs-fetchers-caveats}

Because Nixpkgs fetchers are fixed-output derivations, an [output hash](https://nixos.org/manual/nix/stable/language/advanced-attributes#adv-attr-outputHash) has to be specified, usually indirectly through a `hash` attribute.
Because Nixpkgs fetchers are fixed-output derivations, an [output hash](https://nix.dev/manual/nix/latest/language/advanced-attributes#adv-attr-outputHash) has to be specified, usually indirectly through a `hash` attribute.
This hash refers to the derivation output, which can be different from the remote source itself!

This has the following implications that you should be aware of:
Expand Down Expand Up @@ -135,7 +135,7 @@ Unless you understand how the fetcher you're using calculates the hash from the
Fetchers understand both formats.
Nixpkgs does not standardise on any one format.

You can convert between hash formats with [`nix-hash`](https://nixos.org/manual/nix/stable/command-ref/nix-hash).
You can convert between hash formats with [`nix-hash`](https://nix.dev/manual/nix/latest/command-ref/nix-hash).

5. Extract the hash from a local source archive with `sha256sum`.
Use `nix-prefetch-url file:///path/to/archive` if you want the custom Nix `base32` hash.
Expand All @@ -160,13 +160,13 @@ Here are security considerations for this scenario:
[]{#fetchurl}
## `fetchurl` {#sec-pkgs-fetchers-fetchurl}

`fetchurl` returns a [fixed-output derivation](https://nixos.org/manual/nix/stable/glossary.html#gloss-fixed-output-derivation) which downloads content from a given URL and stores the unaltered contents within the Nix store.
`fetchurl` returns a [fixed-output derivation](https://nix.dev/manual/nix/latest/glossary.html#gloss-fixed-output-derivation) which downloads content from a given URL and stores the unaltered contents within the Nix store.

It uses {manpage}`curl(1)` internally, and allows its behaviour to be modified by specifying a few attributes in the argument to `fetchurl` (see the documentation for attributes `curlOpts`, `curlOptsList`, and `netrcPhase`).

The resulting [store path](https://nixos.org/manual/nix/stable/store/store-path) is determined by the hash given to `fetchurl`, and also the `name` (or `pname` and `version`) values.
The resulting [store path](https://nix.dev/manual/nix/latest/store/store-path) is determined by the hash given to `fetchurl`, and also the `name` (or `pname` and `version`) values.

If neither `name` nor `pname` and `version` are specified when calling `fetchurl`, it will default to using the [basename](https://nixos.org/manual/nix/stable/language/builtins.html#builtins-baseNameOf) of `url` or the first element of `urls`.
If neither `name` nor `pname` and `version` are specified when calling `fetchurl`, it will default to using the [basename](https://nix.dev/manual/nix/latest/language/builtins.html#builtins-baseNameOf) of `url` or the first element of `urls`.
If `pname` and `version` are specified, `fetchurl` will use those values and will ignore `name`, even if it is also specified.

### Inputs {#sec-pkgs-fetchers-fetchurl-inputs}
Expand Down Expand Up @@ -209,7 +209,7 @@ If `pname` and `version` are specified, `fetchurl` will use those values and wil

`outputHash` (String; _optional_)
: Hash of the derivation output of `fetchurl` in the format expected by Nix.
See [the documentation on the Nix manual](https://nixos.org/manual/nix/stable/language/advanced-attributes.html#adv-attr-outputHash) for more information about its format.
See [the documentation on the Nix manual](https://nix.dev/manual/nix/latest/language/advanced-attributes.html#adv-attr-outputHash) for more information about its format.

:::{.note}
It is recommended that you use the `hash` attribute instead.
Expand All @@ -221,7 +221,7 @@ If `pname` and `version` are specified, `fetchurl` will use those values and wil

`outputHashAlgo` (String; _optional_)
: Algorithm used to generate the value specified in `outputHash`.
See [the documentation on the Nix manual](https://nixos.org/manual/nix/stable/language/advanced-attributes.html#adv-attr-outputHashAlgo) for more information about the values it supports.
See [the documentation on the Nix manual](https://nix.dev/manual/nix/latest/language/advanced-attributes.html#adv-attr-outputHashAlgo) for more information about the values it supports.

:::{.note}
It is recommended that you use the `hash` attribute instead.
Expand All @@ -233,7 +233,7 @@ If `pname` and `version` are specified, `fetchurl` will use those values and wil

`sha1` (String; _optional_)
: SHA-1 hash of the derivation output of `fetchurl` in the format expected by Nix.
See [the documentation on the Nix manual](https://nixos.org/manual/nix/stable/language/advanced-attributes.html#adv-attr-outputHash) for more information about its format.
See [the documentation on the Nix manual](https://nix.dev/manual/nix/latest/language/advanced-attributes.html#adv-attr-outputHash) for more information about its format.

:::{.note}
It is recommended that you use the `hash` attribute instead.
Expand All @@ -243,7 +243,7 @@ If `pname` and `version` are specified, `fetchurl` will use those values and wil

`sha256` (String; _optional_)
: SHA-256 hash of the derivation output of `fetchurl` in the format expected by Nix.
See [the documentation on the Nix manual](https://nixos.org/manual/nix/stable/language/advanced-attributes.html#adv-attr-outputHash) for more information about its format.
See [the documentation on the Nix manual](https://nix.dev/manual/nix/latest/language/advanced-attributes.html#adv-attr-outputHash) for more information about its format.

:::{.note}
It is recommended that you use the `hash` attribute instead.
Expand All @@ -253,7 +253,7 @@ If `pname` and `version` are specified, `fetchurl` will use those values and wil

`sha512` (String; _optional_)
: SHA-512 hash of the derivation output of `fetchurl` in the format expected by Nix.
See [the documentation on the Nix manual](https://nixos.org/manual/nix/stable/language/advanced-attributes.html#adv-attr-outputHash) for more information about its format.
See [the documentation on the Nix manual](https://nix.dev/manual/nix/latest/language/advanced-attributes.html#adv-attr-outputHash) for more information about its format.

:::{.note}
It is recommended that you use the `hash` attribute instead.
Expand Down Expand Up @@ -285,7 +285,7 @@ If `pname` and `version` are specified, `fetchurl` will use those values and wil

`recursiveHash` (Boolean; _optional_) []{#sec-pkgs-fetchers-fetchurl-inputs-recursiveHash}
: If set to `true`, will signal to Nix that the hash given to `fetchurl` was calculated using the `"recursive"` mode.
See [the documentation on the Nix manual](https://nixos.org/manual/nix/stable/language/advanced-attributes.html#adv-attr-outputHashMode) for more information about the existing modes.
See [the documentation on the Nix manual](https://nix.dev/manual/nix/latest/language/advanced-attributes.html#adv-attr-outputHashMode) for more information about the existing modes.

By default, `fetchurl` uses `"recursive"` mode when the `executable` attribute is set to `true`, so you don't need to specify `recursiveHash` in this case.

Expand Down Expand Up @@ -331,7 +331,7 @@ If `pname` and `version` are specified, `fetchurl` will use those values and wil
_Default value_: `null`.

`netrcImpureEnvVars` (List of String; _optional_)
: If specified, `fetchurl` will add these environment variable names to the list of [impure environment variables](https://nixos.org/manual/nix/stable/language/advanced-attributes.html#adv-attr-impureEnvVars), which will be passed from the environment of the calling user to the builder running the `fetchurl` code.
: If specified, `fetchurl` will add these environment variable names to the list of [impure environment variables](https://nix.dev/manual/nix/latest/language/advanced-attributes.html#adv-attr-impureEnvVars), which will be passed from the environment of the calling user to the builder running the `fetchurl` code.

This is useful when used with `netrcPhase` to hide any secrets that are used in it, because the script in `netrcPhase` only needs to reference the environment variables with the secrets in them instead.
However, note that these are called _impure_ variables for a reason:
Expand Down Expand Up @@ -372,7 +372,7 @@ If `pname` and `version` are specified, `fetchurl` will use those values and wil
_Default value:_ `{}`.

`preferLocalBuild` (Boolean; _optional_)
: This is the same attribute as [defined in the Nix manual](https://nixos.org/manual/nix/stable/language/advanced-attributes.html#adv-attr-preferLocalBuild).
: This is the same attribute as [defined in the Nix manual](https://nix.dev/manual/nix/latest/language/advanced-attributes.html#adv-attr-preferLocalBuild).
It is `true` by default because making a remote machine download the content just duplicates network traffic (since the local machine might download the results from the derivation anyway), but this could be useful in cases where network access is restricted on local machines.

_Default value:_ `true`.
Expand Down Expand Up @@ -519,7 +519,7 @@ See [](#chap-pkgs-fetchers-caveats) for more details on how to work with the `ha

## `fetchzip` {#sec-pkgs-fetchers-fetchzip}

Returns a [fixed-output derivation](https://nixos.org/manual/nix/stable/glossary.html#gloss-fixed-output-derivation) which downloads an archive from a given URL and decompresses it.
Returns a [fixed-output derivation](https://nix.dev/manual/nix/latest/glossary.html#gloss-fixed-output-derivation) which downloads an archive from a given URL and decompresses it.

Despite its name, `fetchzip` is not limited to `.zip` files but can also be used with [various compressed tarball formats](#tar-files) by default.
This can extended by specifying additional attributes, see [](#ex-fetchers-fetchzip-rar-archive) to understand how to do that.
Expand Down
4 changes: 2 additions & 2 deletions doc/build-helpers/images/binarycache.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
`pkgs.mkBinaryCache` is a function for creating Nix flat-file binary caches.
Such a cache exists as a directory on disk, and can be used as a Nix substituter by passing `--substituter file:///path/to/cache` to Nix commands.

Nix packages are most commonly shared between machines using [HTTP, SSH, or S3](https://nixos.org/manual/nix/stable/package-management/sharing-packages.html), but a flat-file binary cache can still be useful in some situations.
Nix packages are most commonly shared between machines using [HTTP, SSH, or S3](https://nix.dev/manual/nix/latest/package-management/sharing-packages.html), but a flat-file binary cache can still be useful in some situations.
For example, you can copy it directly to another machine, or make it available on a network file system.
It can also be a convenient way to make some Nix packages available inside a container via bind-mounting.

Expand All @@ -13,7 +13,7 @@ The transitive closure of these derivations' outputs will be copied into the cac

::: {.note}
This function is meant for advanced use cases.
The more idiomatic way to work with flat-file binary caches is via the [nix-copy-closure](https://nixos.org/manual/nix/stable/command-ref/nix-copy-closure.html) command.
The more idiomatic way to work with flat-file binary caches is via the [nix-copy-closure](https://nix.dev/manual/nix/latest/command-ref/nix-copy-closure.html) command.
You may also want to consider [dockerTools](#sec-pkgs-dockerTools) for your containerization needs.
:::

Expand Down
Loading

0 comments on commit 0abbbd2

Please sign in to comment.