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 overriding allowSubstitutes without modification to derivation #3686

Closed
xbreak opened this issue Jun 11, 2020 · 3 comments
Closed

Allow overriding allowSubstitutes without modification to derivation #3686

xbreak opened this issue Jun 11, 2020 · 3 comments
Labels
feature Feature request or proposal stale

Comments

@xbreak
Copy link
Contributor

xbreak commented Jun 11, 2020

Is your feature request related to a problem? Please describe.

Since caching sources of a closure seems next-to-impossible at the moment[1], the next best thing is to at least to be able to cache the output of any derivation. But if allowSubstitutes is set (or left undefined?), it prevents that.

Describe the solution you'd like

Add option that allows user to override the behaviour set by allowSubstitutes. E.g. always-allow-substitutes = true|false

Describe alternatives you've considered

overrideAttrs is not always possible and would unnecessarily modify the derivation. If the documentation is correct [2] in that allowSubstitutes is only a build optimization it shouldn't introduce an impurity to allow the attribute to be overridden by an option.

Additional context

[1] https://discourse.nixos.org/t/using-nixos-in-an-isolated-environment/3369
[2] https://nixos.org/nix/manual/#sec-advanced-attributes

allowSubstitutes
If this attribute is set to false, then Nix will always build this derivation; it will not try to substitute its outputs. This is useful for very trivial derivations (such as writeText in Nixpkgs) that are cheaper to build than to substitute from a binary cache.

@edolstra edolstra added feature Feature request or proposal and removed improvement labels Jun 12, 2020
@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/meaning-of-preferlocalbuild/6047/8

@stale
Copy link

stale bot commented Feb 13, 2021

I marked this as stale due to inactivity. → More info

@fricklerhandwerk
Copy link
Contributor

Closed by #8047

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request or proposal stale
Projects
None yet
Development

No branches or pull requests

4 participants