mirror of
https://github.com/oxalica/nil.git
synced 2025-12-23 09:19:49 +00:00
This helps inference for the common dynamic system access pattern.
Example:
```nix
{
outputs =
{ flake-utils, nixpkgs, ... }:
flake-utils.lib.eachDefaultSystem (system: {
packages.hello = nixpkgs.legacyPackages.${system}.hello;
# ^ ^ What should this resolve to?
# ^ Dynamic attribute.
}
}
```
Thus we pick a specific "default" system for fallback. Then
`nixpkgs.legacyPackages.${system}.hello` can be resolved to, for
example, `nixpkgs.legacyPackages.x86_64-linux.hello`, which we know is
a `derivation`.
|
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||