1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 18:31:49 +02:00

* Allow the canonical system name to be specified at runtime in the

Nix config file.
This commit is contained in:
Eelco Dolstra 2006-07-06 15:30:37 +00:00
parent a945fb7905
commit d51aede4af
6 changed files with 27 additions and 8 deletions

View file

@ -93,6 +93,8 @@ static void initAndRun(int argc, char * * argv)
nixDBPath = getEnv("NIX_DB_DIR", nixStateDir + "/db");
nixConfDir = canonPath(getEnv("NIX_CONF_DIR", NIX_CONF_DIR));
thisSystem = querySetting("system", SYSTEM);
/* Catch SIGINT. */
struct sigaction act, oact;
act.sa_handler = sigintHandler;

View file

@ -17,6 +17,7 @@ bool tryFallback = false;
Verbosity buildVerbosity = lvlInfo;
unsigned int maxBuildJobs = 1;
bool readOnlyMode = false;
string thisSystem = "unset";
static bool settingsRead = false;
@ -26,7 +27,7 @@ static map<string, Strings> settings;
string & at(Strings & ss, unsigned int n)
{
Strings::iterator i =ss.begin();
Strings::iterator i = ss.begin();
advance(i, n);
return *i;
}

View file

@ -53,6 +53,9 @@ extern unsigned int maxBuildJobs;
database. */
extern bool readOnlyMode;
/* The canonical system name, as returned by config.guess. */
extern string thisSystem;
Strings querySetting(const string & name, const Strings & def);

View file

@ -16,9 +16,6 @@
#include "util.hh"
string thisSystem = SYSTEM;
Error::Error(const format & f)
{
err = f.str();

View file

@ -55,10 +55,6 @@ typedef list<Path> Paths;
typedef set<Path> PathSet;
/* The canonical system name, as returned by config.guess. */
extern string thisSystem;
/* Return an environment variable. */
string getEnv(const string & key, const string & def = "");