FAQ: Difference between revisions

imported>Pancho
imported>Pancho
m →‎How can I disable the binary cache and build everything locally?: Prefer single quotes in shell if no variable interpolation is needed, also, slightly easier to type
Line 290: Line 290:
== How can I disable the binary cache and build everything locally? ==
== How can I disable the binary cache and build everything locally? ==


Set the binary caches to an empty list: <code>nix.binaryCaches = [];</code> in <code>configuration.nix</code> or pass ad-hoc <code>--option binary-caches ""</code> as parameter to nix-build or its wrappers.
Set the binary caches to an empty list: <code>nix.binaryCaches = [];</code> in <code>configuration.nix</code> or pass ad-hoc <code>--option binary-caches <nowiki>''</nowiki></code> as parameter to nix-build or its wrappers.


This is also useful to make simple configuration changes in NixOS (ex.: network related), when no network connectivity is available:
This is also useful to make simple configuration changes in NixOS (ex.: network related), when no network connectivity is available:


<syntaxhighlight lang="bash">nixos-rebuild switch --option binary-caches ""</syntaxhighlight>
<syntaxhighlight lang="bash">nixos-rebuild switch --option binary-caches ''</syntaxhighlight>


== How do I enable sandboxed builds on non-NixOS? ==
== How do I enable sandboxed builds on non-NixOS? ==