aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-24 01:04:21 +0000
committertv <tv@krebsco.de>2026-11-24 01:12:10 +0000
commita021d211906d23c9e3454da974806454e9ec74c2 (patch)
tree8a9186c4bc6b0050b83a89536c458d5c2f497355 /README.md
parentba2dc2e941fe3170ccd85d319982d48d78081177 (diff)
populate lib: leave out sources whose types are set to null
A source's type can depend on a condition, e.g. nixpkgs.file = optionalSource local { ... }, which returns the settings if the condition holds, and else null. A source whose types are all null, at least one of them set to null rather than left unset, gets the type null, and evalSource leaves it out. A type left unset, e.g. by lib.mkIf false, still counts as missing, so an empty source stays an error. krops' lib provides optionalSource, too.
Diffstat (limited to 'README.md')
-rw-r--r--README.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/README.md b/README.md
index f197dc9..4ed56d2 100644
--- a/README.md
+++ b/README.md
@@ -345,7 +345,9 @@ that means.
passes to populate. [populate's
README](pkgs/populate/README.md#source-types) describes the source types:
`derivation`, `file`, `flake`, `flake-input`, `git`, `pass`, `passage`,
-`pipe`, and `symlink`.
+`pipe`, and `symlink`, and [how to write
+them](pkgs/populate/README.md#sources-in-nix), e.g. with
+`klib.optionalSource`, which leaves a source out unless a condition holds.
## Flake inputs from sources