documentation: use sections instead of list items
This commit is contained in:
parent
e43b0f5b12
commit
09860c16ce
|
@ -18,51 +18,56 @@ values such as packages or NixOS modules provided by the flake).
|
||||||
Flake references (*flakerefs*) are a way to specify the location of a
|
Flake references (*flakerefs*) are a way to specify the location of a
|
||||||
flake. These have two different forms:
|
flake. These have two different forms:
|
||||||
|
|
||||||
* An attribute set representation, e.g.
|
|
||||||
|
|
||||||
```nix
|
## Attribute set representation
|
||||||
{
|
|
||||||
type = "github";
|
|
||||||
owner = "NixOS";
|
|
||||||
repo = "nixpkgs";
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
The only required attribute is `type`. The supported types are
|
Example:
|
||||||
listed below.
|
|
||||||
|
|
||||||
* A URL-like syntax, e.g.
|
```nix
|
||||||
|
{
|
||||||
|
type = "github";
|
||||||
|
owner = "NixOS";
|
||||||
|
repo = "nixpkgs";
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
```
|
The only required attribute is `type`. The supported types are
|
||||||
github:NixOS/nixpkgs
|
listed below.
|
||||||
```
|
|
||||||
|
|
||||||
These are used on the command line as a more convenient alternative
|
## URL-like syntax
|
||||||
to the attribute set representation. For instance, in the command
|
|
||||||
|
|
||||||
```console
|
Example:
|
||||||
# nix build github:NixOS/nixpkgs#hello
|
|
||||||
```
|
|
||||||
|
|
||||||
`github:NixOS/nixpkgs` is a flake reference (while `hello` is an
|
```
|
||||||
output attribute). They are also allowed in the `inputs` attribute
|
github:NixOS/nixpkgs
|
||||||
of a flake, e.g.
|
```
|
||||||
|
|
||||||
```nix
|
These are used on the command line as a more convenient alternative
|
||||||
inputs.nixpkgs.url = github:NixOS/nixpkgs;
|
to the attribute set representation. For instance, in the command
|
||||||
```
|
|
||||||
|
|
||||||
is equivalent to
|
```console
|
||||||
|
# nix build github:NixOS/nixpkgs#hello
|
||||||
|
```
|
||||||
|
|
||||||
```nix
|
`github:NixOS/nixpkgs` is a flake reference (while `hello` is an
|
||||||
inputs.nixpkgs = {
|
output attribute). They are also allowed in the `inputs` attribute
|
||||||
type = "github";
|
of a flake, e.g.
|
||||||
owner = "NixOS";
|
|
||||||
repo = "nixpkgs";
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
## Examples
|
```nix
|
||||||
|
inputs.nixpkgs.url = github:NixOS/nixpkgs;
|
||||||
|
```
|
||||||
|
|
||||||
|
is equivalent to
|
||||||
|
|
||||||
|
```nix
|
||||||
|
inputs.nixpkgs = {
|
||||||
|
type = "github";
|
||||||
|
owner = "NixOS";
|
||||||
|
repo = "nixpkgs";
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
Here are some examples of flake references in their URL-like representation:
|
Here are some examples of flake references in their URL-like representation:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue