forked from extern/flakelight
Clarify passing of inputs in documentation
This commit is contained in:
parent
f34d07dd57
commit
b7002c7cad
12
API_GUIDE.md
12
API_GUIDE.md
@ -92,15 +92,15 @@ modules. These inputs get passed as the `inputs` module argument, and are used
|
||||
for `inputs` and `inputs'` in the package set.
|
||||
|
||||
Default values are automatically initialized from your flake inputs by reading
|
||||
your `flake.lock`. Note that this does not include the `self` argument, which
|
||||
must be passed explicitly if you want to use it. The default values also are not
|
||||
affected by nix command flags like `--override-input`, so inputs should be
|
||||
passed to enable full CLI functionality.
|
||||
your `flake.lock`. Note that this does not include the `self` argument; for
|
||||
using `self`, use `inherit inputs` or otherwise define inputs. The default
|
||||
values also are not affected by nix command flags like `--override-input`, so
|
||||
inputs should be passed to enable full CLI functionality.
|
||||
|
||||
Flakelight will add a recent `nixpkgs` input if your flake does not have one.
|
||||
Other flakelight modules may provide default inputs for their dependencies.
|
||||
|
||||
To use a different nixpkgs from the built-in default:
|
||||
To use a different nixpkgs from the built-in default (passing all inputs):
|
||||
|
||||
```nix
|
||||
{
|
||||
@ -108,7 +108,7 @@ To use a different nixpkgs from the built-in default:
|
||||
flakelight.url = "github:nix-community/flakelight";
|
||||
nixpkgs.url = "nixpkgs/nixpkgs-unstable";
|
||||
};
|
||||
outputs = { flakelight, ... }:
|
||||
outputs = { flakelight, ... }@inputs:
|
||||
flakelight ./. {
|
||||
inherit inputs;
|
||||
};
|
||||
|
@ -73,7 +73,7 @@ To use a different nixpkgs, you can instead use:
|
||||
nixpkgs.url = "nixpkgs/nixpkgs-unstable";
|
||||
flakelight.url = "github:nix-community/flakelight";
|
||||
};
|
||||
outputs = { flakelight, ... }:
|
||||
outputs = { flakelight, ... }@inputs:
|
||||
flakelight ./. {
|
||||
inherit inputs;
|
||||
devShell.packages = pkgs: [ pkgs.hello pkgs.coreutils ];
|
||||
@ -182,7 +182,7 @@ like the following. Most attributes can be autoloaded.
|
||||
{
|
||||
description = "My C application.";
|
||||
inputs.flakelight.url = "github:nix-community/flakelight";
|
||||
outputs = { flakelight, ... }@inputs:
|
||||
outputs = { flakelight, ... }:
|
||||
flakelight ./. {
|
||||
license = "AGPL-3.0-or-later";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user