From 7395e091c535df996f2dde3fb8170f2a211fbae5 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Tue, 3 Dec 2019 18:01:45 +0100 Subject: [PATCH 1/2] doc/manual: add note to `allowSubstitutes` advanced attribute --- doc/manual/expressions/advanced-attributes.xml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/doc/manual/expressions/advanced-attributes.xml b/doc/manual/expressions/advanced-attributes.xml index 07b0d97d3..e1fbe6291 100644 --- a/doc/manual/expressions/advanced-attributes.xml +++ b/doc/manual/expressions/advanced-attributes.xml @@ -325,12 +325,23 @@ big = "a very long string"; allowSubstitutes - If this attribute is set to + + 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. + build than to substitute from a binary cache. + + You need to have a builder configured which satisfies + the derivation’s system attribute, since the + derivation cannot be substituted. Thus it is usually a good idea + to align system with + builtins.currentSystem when setting + allowSubstitutes to false. + For most trivial derivations this should be the case. + + From 7923e22276f4b7fb65df04f53d5e0c4298b61e6d Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Tue, 3 Dec 2019 18:22:27 +0100 Subject: [PATCH 2/2] doc/manual: add ids to the advanced attribute definitions This makes it possible to reference single attribute definitions, for pointing people to their exact definition. --- .../expressions/advanced-attributes.xml | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/manual/expressions/advanced-attributes.xml b/doc/manual/expressions/advanced-attributes.xml index e1fbe6291..372d03de7 100644 --- a/doc/manual/expressions/advanced-attributes.xml +++ b/doc/manual/expressions/advanced-attributes.xml @@ -11,7 +11,7 @@ attributes. - allowedReferences + allowedReferences The optional attribute allowedReferences specifies a list of legal @@ -32,7 +32,7 @@ allowedReferences = []; - allowedRequisites + allowedRequisites This attribute is similar to allowedReferences, but it specifies the legal @@ -50,7 +50,7 @@ allowedRequisites = [ foobar ]; - disallowedReferences + disallowedReferences The optional attribute disallowedReferences specifies a list of illegal @@ -67,7 +67,7 @@ disallowedReferences = [ foo ]; - disallowedRequisites + disallowedRequisites This attribute is similar to disallowedReferences, but it specifies illegal @@ -85,7 +85,7 @@ disallowedRequisites = [ foobar ]; - exportReferencesGraph + exportReferencesGraph This attribute allows builders access to the references graph of their inputs. The attribute is a list of @@ -124,7 +124,7 @@ derivation { - impureEnvVars + impureEnvVars This attribute allows you to specify a list of environment variables that should be passed from the environment @@ -158,9 +158,9 @@ impureEnvVars = [ "http_proxy" "https_proxy" ... ]; - outputHash - outputHashAlgo - outputHashMode + outputHash + outputHashAlgo + outputHashMode These attributes declare that the derivation is a so-called fixed-output derivation, which @@ -282,7 +282,7 @@ stdenv.mkDerivation { - passAsFile + passAsFile A list of names of attributes that should be passed via files rather than environment variables. For example, @@ -309,7 +309,7 @@ big = "a very long string"; - preferLocalBuild + preferLocalBuild If this attribute is set to true and - allowSubstitutes + allowSubstitutes If this attribute is set to