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

Allow follows in top-level inputs and validate flake inputs #1254

Merged
merged 2 commits into from
Jun 6, 2024

Conversation

sandydoo
Copy link
Member

@sandydoo sandydoo commented Jun 6, 2024

Fixes #1049.

There are two commits to this:

  1. Removing null attributes when serializing the flake input struct. This fixes Can't follow nixpkgs version provided by custom flake #1049.
  2. Validating that only one of url and follows are set.

2 is a little controversial because Nix actually allows setting both url and follows at the same time. The following example will not trigger an error in Nix:

{
  nixpkgs = {
    url = "...";
    follows = "other-input/nixpkgs";
  };
}

Nix seems to implicitly prioritise follows over url, which could be quite confusing. Our choice is whether to do better than Nix in this situation and throw a descriptive error, or allow it through and let Nix decide what's best.

@sandydoo sandydoo added the bug Something isn't working label Jun 6, 2024
@sandydoo sandydoo requested a review from domenkozar June 6, 2024 16:52
@domenkozar domenkozar merged commit 866ecad into main Jun 6, 2024
248 of 264 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't follow nixpkgs version provided by custom flake
2 participants