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

More hermetic release.nix and examples #310

merged 6 commits into from
Feb 24, 2021


Copy link

@samueldr samueldr commented Feb 21, 2021

Both release.nix and examples/**/default.nix relied on the implicit behaviours of default.nix, which in turn, uses local.nix if found.

This is not hermetic.

This changes how it is all implemented, with all of the previously mentioned systems using a proper entry point, and default.nix now composing on top of that same entry point.

So now we're left with a simple default.nix that serves mainly to break its own hermeticity, and a more proper eval-with-configuration.nix "shim" that serves to do the job default.nix was being used for.

I say more hermetic, since this all still relies on <nixpkgs>. But this is desired here.

In addition, the error messages for "default" building with the examples have been updated.

This is required for more hermetic evals.

A simple thing to try is, before this change, replace `default.nix` with
`throw "No thanks..."`. It would throw. It was also possible to observe
`local.nix` was being included by the warnings.

Wioth this change, `release.nix` does not include `local.nix` through

I think this was the last piece of Mobile NixOS that actually relied on
`default.nix` being a thing. We have finally completely inverted the
control, where `default.nix` uses the helpers, rather than the helpers
evaluating a specialized `default.nix`.

From now on, it should be entirely safe to experiment with
`default.nix`. We should be able to **fail noisily** when a user builds
the default empty configuration!
@samueldr samueldr force-pushed the fix/more-hermetic-release.nix branch from dbec9e0 to 32a7185 Compare February 24, 2021 01:17
@samueldr samueldr merged commit 0d9c6ce into NixOS:master Feb 24, 2021
@samueldr samueldr deleted the fix/more-hermetic-release.nix branch February 24, 2021 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.

None yet

1 participant