17 , COMPRESSION_BZIP2
= 2
23 typedef std::map
<string
, string
> SettingsMap
;
27 void processEnvironment();
31 void set(const string
& name
, const string
& value
);
33 string
get(const string
& name
, const string
& def
);
35 Strings
get(const string
& name
, const Strings
& def
);
37 bool get(const string
& name
, bool def
);
39 int get(const string
& name
, int def
);
45 void unpack(const string
& pack
);
47 SettingsMap
getOverrides();
49 /* The directory where we store sources and derived files. */
52 Path nixDataDir
; /* !!! fix */
54 /* The directory where we log various operations. */
57 /* The directory where state is stored. */
60 /* The directory where we keep the SQLite database. */
63 /* The directory where configuration files are stored. */
66 /* The directory where internal helper programs are stored. */
69 /* The directory where the main programs are stored. */
72 /* File name of the socket the daemon listens to. */
73 Path nixDaemonSocketFile
;
75 /* Whether to keep temporary directories of failed builds. */
78 /* Whether to keep building subgoals when a sibling (another
79 subgoal of the same goal) fails. */
82 /* User and groud id of the client issuing the build request. Used to set
83 the owner and group of the kept temporary directories of failed
88 /* Whether, if we cannot realise the known closure corresponding
89 to a derivation, we should try to normalise the derivation
93 /* Verbosity level for build output. */
94 Verbosity buildVerbosity
;
96 /* Maximum number of parallel build jobs. 0 means unlimited. */
97 unsigned int maxBuildJobs
;
99 /* Number of CPU cores to utilize in parallel within a build,
100 i.e. by passing this number to Make via '-j'. 0 means that the
101 number of actual CPU cores on the local host ought to be
103 unsigned int buildCores
;
105 /* Read-only mode. Don't copy stuff to the store, don't change
109 /* The canonical system name, as returned by config.guess. */
112 /* The maximum time in seconds that a builer can go without
113 producing any output on stdout/stderr before it is killed. 0
115 time_t maxSilentTime
;
117 /* The maximum duration in seconds that a builder can run. 0
121 /* The substituters. There are programs that can somehow realise
122 a store path without building, e.g., by downloading it or
123 copying it from a CD. */
126 /* Whether to use build hooks (for distributed builds). Sometimes
127 users want to disable this from the command-line. */
130 /* Whether buildDerivations() should print out lines on stderr in
131 a fixed format to allow its progress to be monitored. Each
132 line starts with a "@". The following are defined:
134 @ build-started <drvpath> <outpath> <system> <logfile>
135 @ build-failed <drvpath> <outpath> <exitcode> <error text>
136 @ build-succeeded <drvpath> <outpath>
137 @ substituter-started <outpath> <substituter>
138 @ substituter-failed <outpath> <exitcode> <error text>
139 @ substituter-succeeded <outpath>
141 Best combined with --no-build-output, otherwise stderr might
142 conceivably contain lines in this format printed by the
144 bool printBuildTrace
;
146 /* Amount of reserved space for the garbage collector
147 (/nix/var/nix/db/reserved). */
150 /* Whether SQLite should use fsync. */
153 /* Whether SQLite should use WAL mode. */
156 /* Whether to call sync() before registering a path as valid. */
157 bool syncBeforeRegistering
;
159 /* Whether to use substitutes. */
162 /* The Unix group that contains the build users. */
163 string buildUsersGroup
;
165 /* Whether to build in chroot. */
168 /* Set of ssh connection strings for the ssh substituter */
169 Strings sshSubstituterHosts
;
171 /* Whether to use the ssh substituter at all */
172 bool useSshSubstituter
;
174 /* Whether to impersonate a Linux 2.6 machine on newer kernels. */
175 bool impersonateLinux26
;
177 /* Whether to store build logs. */
180 /* Whether to compress logs. */
181 enum CompressionType logCompression
;
183 /* Maximum number of bytes a builder can write to stdout/stderr
184 before being killed (0 means no limit). */
185 unsigned long maxLogSize
;
187 /* Whether to cache build failures. */
190 /* How often (in seconds) to poll for locks. */
191 unsigned int pollInterval
;
193 /* Whether to check if new GC roots can in fact be found by the
194 garbage collector. */
195 bool checkRootReachability
;
197 /* Whether the garbage collector should keep outputs of live
201 /* Whether the garbage collector should keep derivers of live
203 bool gcKeepDerivations
;
205 /* Whether to automatically replace files with identical contents
207 bool autoOptimiseStore
;
209 /* Whether to add derivations as a dependency of user environments
210 (to prevent them from being GCed). */
211 bool envKeepDerivations
;
213 /* Whether to lock the Nix client and worker to the same CPU. */
216 /* Whether to show a stack trace if Nix evaluation fails. */
219 /* A list of URL prefixes that can return Nix build logs. */
222 /* Whether the importNative primop should be enabled */
223 bool enableImportNative
;
226 SettingsMap settings
, overrides
;
228 void _get(string
& res
, const string
& name
);
229 void _get(bool & res
, const string
& name
);
230 void _get(StringSet
& res
, const string
& name
);
231 void _get(Strings
& res
, const string
& name
);
232 template<class N
> void _get(N
& res
, const string
& name
);
236 // FIXME: don't use a global variable.
237 extern Settings settings
;
240 extern const string nixVersion
;