Nice, lib.packagesFromDirectoryRecursive now supports nested scopes!

packagesFromDirectoryRecursive transforms a directory tree of packages into a nested attribute set of derivations. You can use it to manage a package set in a similar way to by-name in nixpkgs (without the sharding part). The package files in tree must be suitable for callPackage.

Subdirectories in the tree result in nested attribute sets. In the following example, packages d, e and f will be in a nested attribute set called my-namespace.

my-packages
├── a.nix
├── b.nix
├── c
│ ├── my-extra-feature.patch
│ ├── package.nix
│ └── support-definitions.nix
└── my-namespace
├── d.nix
├── e.nix
└── f
└── package.nix

Previously, this would only use one scope (my-packages), so e could only depend on d as my-packages.d. With the introduction of nested scopes, e can refer to d within the same scope directly.

PR: github.com/NixOS/nixpkgs/pull/

function doc on noogle (which isn't yet updated for the new behavior): noogle.dev/f/lib/packagesFromD

0

If you have a fediverse account, you can quote this note from your own instance. Search https://infosec.exchange/users/katexochen/statuses/114230458727016712 on your instance and quote it. (Note that quoting is not supported in Mastodon.)