14 typedef std::map
<string
, string
> SettingsMap
;
18 void processEnvironment();
22 void set(const string
& name
, const string
& value
);
24 string
get(const string
& name
, const string
& def
);
26 Strings
get(const string
& name
, const Strings
& def
);
28 bool get(const string
& name
, bool def
);
30 int get(const string
& name
, int def
);
36 void unpack(const string
& pack
);
38 SettingsMap
getOverrides();
40 /* The directory where we store sources and derived files. */
43 Path nixDataDir
; /* !!! fix */
45 /* The directory where we log various operations. */
48 /* The directory where state is stored. */
51 /* The directory where we keep the SQLite database. */
54 /* The directory where configuration files are stored. */
57 /* The directory where internal helper programs are stored. */
60 /* The directory where the main programs are stored. */
63 /* File name of the socket the daemon listens to. */
64 Path nixDaemonSocketFile
;
66 /* Whether to keep temporary directories of failed builds. */
69 /* Whether to keep building subgoals when a sibling (another
70 subgoal of the same goal) fails. */
73 /* User and groud id of the client issuing the build request. Used to set
74 the owner and group of the kept temporary directories of failed
79 /* Whether, if we cannot realise the known closure corresponding
80 to a derivation, we should try to normalise the derivation
84 /* Verbosity level for build output. */
85 Verbosity buildVerbosity
;
87 /* Maximum number of parallel build jobs. 0 means unlimited. */
88 unsigned int maxBuildJobs
;
90 /* Number of CPU cores to utilize in parallel within a build,
91 i.e. by passing this number to Make via '-j'. 0 means that the
92 number of actual CPU cores on the local host ought to be
94 unsigned int buildCores
;
96 /* Read-only mode. Don't copy stuff to the store, don't change
100 /* The canonical system name, as returned by config.guess. */
103 /* The maximum time in seconds that a builer can go without
104 producing any output on stdout/stderr before it is killed. 0
106 time_t maxSilentTime
;
108 /* The maximum duration in seconds that a builder can run. 0
112 /* The substituters. There are programs that can somehow realise
113 a store path without building, e.g., by downloading it or
114 copying it from a CD. */
117 /* Whether to use build hooks (for distributed builds). Sometimes
118 users want to disable this from the command-line. */
121 /* Whether buildDerivations() should print out lines on stderr in
122 a fixed format to allow its progress to be monitored. Each
123 line starts with a "@". The following are defined:
125 @ build-started <drvpath> <outpath> <system> <logfile>
126 @ build-failed <drvpath> <outpath> <exitcode> <error text>
127 @ build-succeeded <drvpath> <outpath>
128 @ substituter-started <outpath> <substituter>
129 @ substituter-failed <outpath> <exitcode> <error text>
130 @ substituter-succeeded <outpath>
132 Best combined with --no-build-output, otherwise stderr might
133 conceivably contain lines in this format printed by the
135 bool printBuildTrace
;
137 /* Amount of reserved space for the garbage collector
138 (/nix/var/nix/db/reserved). */
141 /* Whether SQLite should use fsync. */
144 /* Whether SQLite should use WAL mode. */
147 /* Whether to call sync() before registering a path as valid. */
148 bool syncBeforeRegistering
;
150 /* Whether to use substitutes. */
153 /* The Unix group that contains the build users. */
154 string buildUsersGroup
;
156 /* Whether to build in chroot. */
159 /* Set of ssh connection strings for the ssh substituter */
160 Strings sshSubstituterHosts
;
162 /* Whether to use the ssh substituter at all */
163 bool useSshSubstituter
;
165 /* Whether to impersonate a Linux 2.6 machine on newer kernels. */
166 bool impersonateLinux26
;
168 /* Whether to store build logs. */
171 /* Whether to compress logs. */
174 /* Maximum number of bytes a builder can write to stdout/stderr
175 before being killed (0 means no limit). */
176 unsigned long maxLogSize
;
178 /* Whether to cache build failures. */
181 /* How often (in seconds) to poll for locks. */
182 unsigned int pollInterval
;
184 /* Whether to check if new GC roots can in fact be found by the
185 garbage collector. */
186 bool checkRootReachability
;
188 /* Whether the garbage collector should keep outputs of live
192 /* Whether the garbage collector should keep derivers of live
194 bool gcKeepDerivations
;
196 /* Whether to automatically replace files with identical contents
198 bool autoOptimiseStore
;
200 /* Whether to add derivations as a dependency of user environments
201 (to prevent them from being GCed). */
202 bool envKeepDerivations
;
204 /* Whether to lock the Nix client and worker to the same CPU. */
207 /* Whether to show a stack trace if Nix evaluation fails. */
210 /* A list of URL prefixes that can return Nix build logs. */
213 /* Whether the importNative primop should be enabled */
214 bool enableImportNative
;
217 SettingsMap settings
, overrides
;
219 void _get(string
& res
, const string
& name
);
220 void _get(bool & res
, const string
& name
);
221 void _get(StringSet
& res
, const string
& name
);
222 void _get(Strings
& res
, const string
& name
);
223 template<class N
> void _get(N
& res
, const string
& name
);
227 // FIXME: don't use a global variable.
228 extern Settings settings
;
231 extern const string nixVersion
;