diff options
author | Naïm Favier <n@monade.li> | 2022-03-09 13:14:22 +0100 |
---|---|---|
committer | Naïm Favier <n@monade.li> | 2022-03-11 11:26:34 +0100 |
commit | 9c2266c03171dcf492b6accdb0cde0cb28e156b5 (patch) | |
tree | 224647a4a2e30e03b2580efcf6f5d0303b93916b /nixos/doc/manual | |
parent | a782fa14c8c13e66e1642a310902566a804bb9dc (diff) | |
download | nixpkgs-9c2266c03171dcf492b6accdb0cde0cb28e156b5.tar nixpkgs-9c2266c03171dcf492b6accdb0cde0cb28e156b5.tar.gz nixpkgs-9c2266c03171dcf492b6accdb0cde0cb28e156b5.tar.bz2 nixpkgs-9c2266c03171dcf492b6accdb0cde0cb28e156b5.tar.lz nixpkgs-9c2266c03171dcf492b6accdb0cde0cb28e156b5.tar.xz nixpkgs-9c2266c03171dcf492b6accdb0cde0cb28e156b5.tar.zst nixpkgs-9c2266c03171dcf492b6accdb0cde0cb28e156b5.zip |
lib.types.package: only call toDerivation when necessary
The current logic assumes that everything that isn't a derivation is a store path, but it can also be something that's *coercible* to a store path, like a flake input. Unnecessary uses of `lib.toDerivation` result in errors in pure evaluation mode when `builtins.storePath` is disabled. Also document what a `package` is.
Diffstat (limited to 'nixos/doc/manual')
-rw-r--r-- | nixos/doc/manual/development/option-types.section.md | 3 | ||||
-rw-r--r-- | nixos/doc/manual/from_md/development/option-types.section.xml | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/nixos/doc/manual/development/option-types.section.md b/nixos/doc/manual/development/option-types.section.md index c34ac0367c4..00f1d85bdb6 100644 --- a/nixos/doc/manual/development/option-types.section.md +++ b/nixos/doc/manual/development/option-types.section.md @@ -22,7 +22,8 @@ merging is handled. `types.package` -: A derivation or a store path. +: A top-level store path. This can be an attribute set pointing + to a store path, like a derivation or a flake input. `types.anything` diff --git a/nixos/doc/manual/from_md/development/option-types.section.xml b/nixos/doc/manual/from_md/development/option-types.section.xml index e16453df51e..44472929270 100644 --- a/nixos/doc/manual/from_md/development/option-types.section.xml +++ b/nixos/doc/manual/from_md/development/option-types.section.xml @@ -43,7 +43,9 @@ </term> <listitem> <para> - A derivation or a store path. + A top-level store path. This can be an attribute set + pointing to a store path, like a derivation or a flake + input. </para> </listitem> </varlistentry> |