Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eval and inject types for input flakes #76

Merged
merged 14 commits into from
Apr 22, 2023
Merged

Conversation

oxalica
Copy link
Owner

@oxalica oxalica commented Apr 21, 2023

Part of #14

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`.
@oxalica oxalica merged commit 7032ce6 into main Apr 22, 2023
@oxalica oxalica deleted the feat/eval-input-flakes branch April 22, 2023 02:54
@SuperSandro2000
Copy link

How can I disable this feature? On my editor this also evaluates checks which slows down my machine.

@getchoo
Copy link

getchoo commented May 6, 2023

i was just about to ask the same. i looked through the docs, but couldn't find anything related to it :(

@oxalica
Copy link
Owner Author

oxalica commented May 6, 2023

How can I disable this feature?

Implemented in 21d0870

@SuperSandro2000
Copy link

Thanks!

@dschrempf
Copy link

Hi! Could you please create a release including the mentioned configuration option? I can not use nil anymore because my computer always runs out of memory. Thank you!

@oxalica
Copy link
Owner Author

oxalica commented May 9, 2023

Hi! Could you please create a release including the mentioned configuration option? I can not use nil anymore because my computer always runs out of memory. Thank you!

https://github.com/oxalica/nil/releases/tag/2023-05-09

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants