mirror of
https://github.com/NixOS/nix
synced 2025-07-07 01:51:47 +02:00
Read per-user settings from ~/.config/nix/nix.conf
This commit is contained in:
parent
562585e901
commit
f05d5f89ff
8 changed files with 70 additions and 24 deletions
|
@ -53,19 +53,19 @@ Settings::Settings()
|
|||
void Settings::loadConfFile()
|
||||
{
|
||||
applyConfigFile(nixConfDir + "/nix.conf");
|
||||
|
||||
/* We only want to send overrides to the daemon, i.e. stuff from
|
||||
~/.nix/nix.conf or the command line. */
|
||||
resetOverriden();
|
||||
|
||||
applyConfigFile(getConfigDir() + "/nix/nix.conf");
|
||||
}
|
||||
|
||||
void Settings::set(const string & name, const string & value)
|
||||
{
|
||||
overrides[name] = value;
|
||||
Config::set(name, value);
|
||||
}
|
||||
|
||||
StringMap Settings::getOverrides()
|
||||
{
|
||||
return overrides;
|
||||
}
|
||||
|
||||
unsigned int Settings::getDefaultCores()
|
||||
{
|
||||
return std::max(1U, std::thread::hardware_concurrency());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue