lix/src/nix/flake-check.md

74 lines
1.8 KiB
Markdown
Raw Normal View History

2020-12-23 12:19:53 +00:00
R""(
# Examples
* Evaluate the flake in the current directory, and build its checks:
```console
# nix flake check
```
* Verify that the `patchelf` flake evaluates, but don't build its
checks:
```console
# nix flake check --no-build github:NixOS/patchelf
```
# Description
This command verifies that the flake specified by flake reference
*flake-url* can be evaluated successfully (as detailed below), and
that the derivations specified by the flake's `checks` output can be
built successfully.
2021-06-02 09:26:04 +00:00
If the `keep-going` option is set to `true`, Nix will keep evaluating as much
as it can and report the errors as it encounters them. Otherwise it will stop
at the first error.
2020-12-23 12:19:53 +00:00
# Evaluation checks
2021-06-01 07:05:34 +00:00
The following flake output attributes must be derivations:
2020-12-23 12:19:53 +00:00
* `checks.`*system*`.`*name*
2021-11-24 12:49:07 +00:00
* `defaultPackage.`*system*
* `devShell.`*system*
* `devShells.`*system*`.`*name*
* `nixosConfigurations.`*name*`.config.system.build.toplevel`
2020-12-23 12:19:53 +00:00
* `packages.`*system*`.`*name*
The following flake output attributes must be [app
definitions](./nix3-run.md):
* `apps.`*system*`.`*name*
2021-11-24 12:49:07 +00:00
* `defaultApp.`*system*
2020-12-23 12:19:53 +00:00
The following flake output attributes must be [template
definitions](./nix3-flake-init.md):
* `defaultTemplate`
2021-11-24 12:49:07 +00:00
* `templates.`*name*
2020-12-23 12:19:53 +00:00
The following flake output attributes must be *Nixpkgs overlays*:
* `overlay`
2021-11-24 12:49:07 +00:00
* `overlays.`*name*
2020-12-23 12:19:53 +00:00
The following flake output attributes must be *NixOS modules*:
* `nixosModule`
2021-11-24 12:49:07 +00:00
* `nixosModules.`*name*
2020-12-23 12:19:53 +00:00
The following flake output attributes must be
[bundlers](./nix3-bundle.md):
2021-11-24 12:49:07 +00:00
* `bundlers.`*name*
2020-12-23 12:19:53 +00:00
* `defaultBundler`
In addition, the `hydraJobs` output is evaluated in the same way as
Hydra's `hydra-eval-jobs` (i.e. as a arbitrarily deeply nested
attribute set of derivations). Similarly, the
2023-04-30 13:55:08 +00:00
`legacyPackages`.*system* output is evaluated like `nix-env --query --available `.
2020-12-23 12:19:53 +00:00
)""