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 /* Absolute file name of the 'guix' program. */
72 /* Whether to keep temporary directories of failed builds. */
75 /* Whether to keep building subgoals when a sibling (another
76 subgoal of the same goal) fails. */
79 /* User and groud id of the client issuing the build request. Used to set
80 the owner and group of the kept temporary directories of failed
85 /* Whether, if we cannot realise the known closure corresponding
86 to a derivation, we should try to normalise the derivation
90 /* Verbosity level for build output. */
91 Verbosity buildVerbosity
;
93 /* Maximum number of parallel build jobs. 0 means unlimited. */
94 unsigned int maxBuildJobs
;
96 /* Number of CPU cores to utilize in parallel within a build,
97 i.e. by passing this number to Make via '-j'. 0 means that the
98 number of actual CPU cores on the local host ought to be
100 unsigned int buildCores
;
102 /* Read-only mode. Don't copy stuff to the store, don't change
106 /* The canonical system name, as returned by config.guess. */
109 /* The maximum time in seconds that a builer can go without
110 producing any output on stdout/stderr before it is killed. 0
112 time_t maxSilentTime
;
114 /* The maximum duration in seconds that a builder can run. 0
118 /* The substituters. There are programs that can somehow realise
119 a store path without building, e.g., by downloading it or
120 copying it from a CD. */
123 /* Whether to use build hooks (for distributed builds). Sometimes
124 users want to disable this from the command-line. */
127 /* Whether buildDerivations() should print out lines on stderr in
128 a fixed format to allow its progress to be monitored. Each
129 line starts with a "@". The following are defined:
131 @ build-started <drvpath> <outpath> <system> <logfile> <pid>
132 @ build-failed <drvpath> <outpath> <exitcode> <error text>
133 @ build-succeeded <drvpath> <outpath>
134 @ substituter-started <outpath> <substituter>
135 @ substituter-failed <outpath> <exitcode> <error text>
136 @ substituter-succeeded <outpath>
138 Best combined with --no-build-output, otherwise stderr might
139 conceivably contain lines in this format printed by the
141 bool printBuildTrace
;
143 /* When true, 'buildDerivations' prefixes lines coming from builders so
144 that clients know exactly which line comes from which builder, and
145 which line comes from the daemon itself. The prefix for data coming
146 from builders is "log:PID:LEN:DATA" where PID uniquely identifies the
147 builder (PID is given in "build-started" traces.) */
148 bool multiplexedBuildOutput
;
150 /* Amount of reserved space for the garbage collector
151 (/nix/var/nix/db/reserved). */
154 /* Whether SQLite should use fsync. */
157 /* Whether SQLite should use WAL mode. */
160 /* Whether to call sync() before registering a path as valid. */
161 bool syncBeforeRegistering
;
163 /* Whether to use substitutes. */
166 /* The Unix group that contains the build users. */
167 string buildUsersGroup
;
169 /* Whether to build in chroot. */
172 /* Whether to impersonate a Linux 2.6 machine on newer kernels. */
173 bool impersonateLinux26
;
175 /* Whether to store build logs. */
178 /* Whether to compress logs. */
179 enum CompressionType logCompression
;
181 /* Maximum number of bytes a builder can write to stdout/stderr
182 before being killed (0 means no limit). */
183 unsigned long maxLogSize
;
185 /* Whether to cache build failures. */
188 /* How often (in seconds) to poll for locks. */
189 unsigned int pollInterval
;
191 /* Whether to check if new GC roots can in fact be found by the
192 garbage collector. */
193 bool checkRootReachability
;
195 /* Whether the garbage collector should keep outputs of live
199 /* Whether the garbage collector should keep derivers of live
201 bool gcKeepDerivations
;
203 /* Whether to automatically replace files with identical contents
205 bool autoOptimiseStore
;
207 /* Whether to add derivations as a dependency of user environments
208 (to prevent them from being GCed). */
209 bool envKeepDerivations
;
211 /* Whether to lock the Nix client and worker to the same CPU. */
214 /* Whether to show a stack trace if Nix evaluation fails. */
218 SettingsMap settings
, overrides
;
220 void _get(string
& res
, const string
& name
);
221 void _get(bool & res
, const string
& name
);
222 void _get(StringSet
& res
, const string
& name
);
223 void _get(Strings
& res
, const string
& name
);
224 template<class N
> void _get(N
& res
, const string
& name
);
228 // FIXME: don't use a global variable.
229 extern Settings settings
;
232 extern const string nixVersion
;