17 , COMPRESSION_BZIP2
= 2
23 typedef std::map
<string
, string
> SettingsMap
;
27 void processEnvironment();
29 void set(const string
& name
, const string
& value
);
31 string
get(const string
& name
, const string
& def
);
33 Strings
get(const string
& name
, const Strings
& def
);
35 bool get(const string
& name
, bool def
);
37 int get(const string
& name
, int def
);
43 SettingsMap
getOverrides();
45 /* The directory where we store sources and derived files. */
48 /* The directory where we log various operations. */
51 /* The directory where state is stored. */
54 /* The directory where we keep the SQLite database. */
57 /* The directory where configuration files are stored. */
60 /* The directory where internal helper programs are stored. */
63 /* The directory where the main programs are stored. */
66 /* File name of the socket the daemon listens to. */
67 Path nixDaemonSocketFile
;
69 /* Whether to keep temporary directories of failed builds. */
72 /* Whether to keep building subgoals when a sibling (another
73 subgoal of the same goal) fails. */
76 /* User and groud id of the client issuing the build request. Used to set
77 the owner and group of the kept temporary directories of failed
82 /* Whether, if we cannot realise the known closure corresponding
83 to a derivation, we should try to normalise the derivation
87 /* Verbosity level for build output. */
88 Verbosity buildVerbosity
;
90 /* Maximum number of parallel build jobs. 0 means unlimited. */
91 unsigned int maxBuildJobs
;
93 /* Number of CPU cores to utilize in parallel within a build,
94 i.e. by passing this number to Make via '-j'. 0 means that the
95 number of actual CPU cores on the local host ought to be
97 unsigned int buildCores
;
99 /* Read-only mode. Don't copy stuff to the store, don't change
103 /* The canonical system name, as returned by config.guess. */
106 /* The maximum time in seconds that a builer can go without
107 producing any output on stdout/stderr before it is killed. 0
109 time_t maxSilentTime
;
111 /* The maximum duration in seconds that a builder can run. 0
115 /* The substituters. There are programs that can somehow realise
116 a store path without building, e.g., by downloading it or
117 copying it from a CD. */
120 /* Whether to use build hooks (for distributed builds). Sometimes
121 users want to disable this from the command-line. */
124 /* Whether buildDerivations() should print out lines on stderr in
125 a fixed format to allow its progress to be monitored. Each
126 line starts with a "@". The following are defined:
128 @ build-started <drvpath> <outpath> <system> <logfile> <pid>
129 @ build-failed <drvpath> <outpath> <exitcode> <error text>
130 @ build-succeeded <drvpath> <outpath>
131 @ substituter-started <outpath> <substituter>
132 @ substituter-failed <outpath> <exitcode> <error text>
133 @ substituter-succeeded <outpath>
135 Best combined with --no-build-output, otherwise stderr might
136 conceivably contain lines in this format printed by the
138 bool printBuildTrace
;
140 /* When true, 'buildDerivations' prefixes lines coming from builders so
141 that clients know exactly which line comes from which builder, and
142 which line comes from the daemon itself. The prefix for data coming
143 from builders is "log:PID:LEN:DATA" where PID uniquely identifies the
144 builder (PID is given in "build-started" traces.) */
145 bool multiplexedBuildOutput
;
147 /* Amount of reserved space for the garbage collector
148 (/nix/var/nix/db/reserved). */
151 /* Whether SQLite should use fsync. */
154 /* Whether SQLite should use WAL mode. */
157 /* Whether to call sync() before registering a path as valid. */
158 bool syncBeforeRegistering
;
160 /* Whether to use substitutes. */
163 /* The Unix group that contains the build users. */
164 string buildUsersGroup
;
166 /* Whether to build in chroot. */
169 /* Whether to impersonate a Linux 2.6 machine on newer kernels. */
170 bool impersonateLinux26
;
172 /* Whether to store build logs. */
175 /* Whether to compress logs. */
176 enum CompressionType logCompression
;
178 /* Maximum number of bytes a builder can write to stdout/stderr
179 before being killed (0 means no limit). */
180 unsigned long maxLogSize
;
182 /* Whether to cache build failures. */
185 /* How often (in seconds) to poll for locks. */
186 unsigned int pollInterval
;
188 /* Whether to check if new GC roots can in fact be found by the
189 garbage collector. */
190 bool checkRootReachability
;
192 /* Whether the garbage collector should keep outputs of live
196 /* Whether the garbage collector should keep derivers of live
198 bool gcKeepDerivations
;
200 /* Whether to automatically replace files with identical contents
202 bool autoOptimiseStore
;
204 /* Whether to add derivations as a dependency of user environments
205 (to prevent them from being GCed). */
206 bool envKeepDerivations
;
208 /* Whether to lock the Nix client and worker to the same CPU. */
211 /* Whether to show a stack trace if Nix evaluation fails. */
215 SettingsMap settings
, overrides
;
217 void _get(string
& res
, const string
& name
);
218 void _get(bool & res
, const string
& name
);
219 void _get(StringSet
& res
, const string
& name
);
220 void _get(Strings
& res
, const string
& name
);
221 template<class N
> void _get(N
& res
, const string
& name
);
225 // FIXME: don't use a global variable.
226 extern Settings settings
;
229 extern const string nixVersion
;