From b7002c7cad00078a01d94e4c5caefb6154eba4b4 Mon Sep 17 00:00:00 2001 From: Archit Gupta Date: Sat, 29 Jun 2024 17:12:34 -0700 Subject: [PATCH] Clarify passing of inputs in documentation --- API_GUIDE.md | 12 ++++++------ README.md | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/API_GUIDE.md b/API_GUIDE.md index 3b24fb6..087dab0 100644 --- a/API_GUIDE.md +++ b/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; }; diff --git a/README.md b/README.md index b622a0c..9f11319 100644 --- a/README.md +++ b/README.md @@ -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";