mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
parent
dc6a8f1548
commit
4638bcfb2c
12 changed files with 54 additions and 54 deletions
|
@ -79,7 +79,7 @@ paths. Realisation is a somewhat overloaded term:
|
|||
system). If the path is already valid, we are done immediately.
|
||||
Otherwise, the path and any missing paths in its closure may be
|
||||
produced through substitutes. If there are no (successful)
|
||||
subsitutes, realisation fails.
|
||||
substitutes, realisation fails.
|
||||
|
||||
The output path of each derivation is printed on standard output. (For
|
||||
non-derivations argument, the argument itself is printed.)
|
||||
|
|
|
@ -113,7 +113,7 @@ struct LockFlags
|
|||
/* Whether to commit changes to flake.lock. */
|
||||
bool commitLockFile = false;
|
||||
|
||||
/* Flake inputs to be overriden. */
|
||||
/* Flake inputs to be overridden. */
|
||||
std::map<InputPath, FlakeRef> inputOverrides;
|
||||
|
||||
/* Flake inputs to be updated. This means that any existing lock
|
||||
|
|
|
@ -81,7 +81,7 @@ void loadConfFile()
|
|||
|
||||
/* We only want to send overrides to the daemon, i.e. stuff from
|
||||
~/.nix/nix.conf or the command line. */
|
||||
globalConfig.resetOverriden();
|
||||
globalConfig.resetOverridden();
|
||||
|
||||
auto files = settings.nixUserConfFiles;
|
||||
for (auto file = files.rbegin(); file != files.rend(); file++) {
|
||||
|
|
|
@ -20,7 +20,7 @@ bool Config::set(const std::string & name, const std::string & value)
|
|||
return false;
|
||||
}
|
||||
i->second.setting->set(value, append);
|
||||
i->second.setting->overriden = true;
|
||||
i->second.setting->overridden = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ void Config::addSetting(AbstractSetting * setting)
|
|||
auto i = unknownSettings.find(setting->name);
|
||||
if (i != unknownSettings.end()) {
|
||||
setting->set(i->second);
|
||||
setting->overriden = true;
|
||||
setting->overridden = true;
|
||||
unknownSettings.erase(i);
|
||||
set = true;
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ void Config::addSetting(AbstractSetting * setting)
|
|||
alias, setting->name);
|
||||
else {
|
||||
setting->set(i->second);
|
||||
setting->overriden = true;
|
||||
setting->overridden = true;
|
||||
unknownSettings.erase(i);
|
||||
set = true;
|
||||
}
|
||||
|
@ -69,10 +69,10 @@ void AbstractConfig::reapplyUnknownSettings()
|
|||
set(s.first, s.second);
|
||||
}
|
||||
|
||||
void Config::getSettings(std::map<std::string, SettingInfo> & res, bool overridenOnly)
|
||||
void Config::getSettings(std::map<std::string, SettingInfo> & res, bool overriddenOnly)
|
||||
{
|
||||
for (auto & opt : _settings)
|
||||
if (!opt.second.isAlias && (!overridenOnly || opt.second.setting->overriden))
|
||||
if (!opt.second.isAlias && (!overriddenOnly || opt.second.setting->overridden))
|
||||
res.emplace(opt.first, SettingInfo{opt.second.setting->to_string(), opt.second.setting->description});
|
||||
}
|
||||
|
||||
|
@ -136,10 +136,10 @@ void AbstractConfig::applyConfigFile(const Path & path)
|
|||
} catch (SysError &) { }
|
||||
}
|
||||
|
||||
void Config::resetOverriden()
|
||||
void Config::resetOverridden()
|
||||
{
|
||||
for (auto & s : _settings)
|
||||
s.second.setting->overriden = false;
|
||||
s.second.setting->overridden = false;
|
||||
}
|
||||
|
||||
nlohmann::json Config::toJSON()
|
||||
|
@ -169,7 +169,7 @@ AbstractSetting::AbstractSetting(
|
|||
|
||||
void AbstractSetting::setDefault(const std::string & str)
|
||||
{
|
||||
if (!overriden) set(str);
|
||||
if (!overridden) set(str);
|
||||
}
|
||||
|
||||
nlohmann::json AbstractSetting::toJSON()
|
||||
|
@ -203,7 +203,7 @@ void BaseSetting<T>::convertToArg(Args & args, const std::string & category)
|
|||
.description = fmt("Set the `%s` setting.", name),
|
||||
.category = category,
|
||||
.labels = {"value"},
|
||||
.handler = {[=](std::string s) { overriden = true; set(s); }},
|
||||
.handler = {[=](std::string s) { overridden = true; set(s); }},
|
||||
});
|
||||
|
||||
if (isAppendable())
|
||||
|
@ -212,7 +212,7 @@ void BaseSetting<T>::convertToArg(Args & args, const std::string & category)
|
|||
.description = fmt("Append to the `%s` setting.", name),
|
||||
.category = category,
|
||||
.labels = {"value"},
|
||||
.handler = {[=](std::string s) { overriden = true; set(s, true); }},
|
||||
.handler = {[=](std::string s) { overridden = true; set(s, true); }},
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -365,16 +365,16 @@ bool GlobalConfig::set(const std::string & name, const std::string & value)
|
|||
return false;
|
||||
}
|
||||
|
||||
void GlobalConfig::getSettings(std::map<std::string, SettingInfo> & res, bool overridenOnly)
|
||||
void GlobalConfig::getSettings(std::map<std::string, SettingInfo> & res, bool overriddenOnly)
|
||||
{
|
||||
for (auto & config : *configRegistrations)
|
||||
config->getSettings(res, overridenOnly);
|
||||
config->getSettings(res, overriddenOnly);
|
||||
}
|
||||
|
||||
void GlobalConfig::resetOverriden()
|
||||
void GlobalConfig::resetOverridden()
|
||||
{
|
||||
for (auto & config : *configRegistrations)
|
||||
config->resetOverriden();
|
||||
config->resetOverridden();
|
||||
}
|
||||
|
||||
nlohmann::json GlobalConfig::toJSON()
|
||||
|
|
|
@ -71,9 +71,9 @@ public:
|
|||
/**
|
||||
* Adds the currently known settings to the given result map `res`.
|
||||
* - res: map to store settings in
|
||||
* - overridenOnly: when set to true only overridden settings will be added to `res`
|
||||
* - overriddenOnly: when set to true only overridden settings will be added to `res`
|
||||
*/
|
||||
virtual void getSettings(std::map<std::string, SettingInfo> & res, bool overridenOnly = false) = 0;
|
||||
virtual void getSettings(std::map<std::string, SettingInfo> & res, bool overriddenOnly = false) = 0;
|
||||
|
||||
/**
|
||||
* Parses the configuration in `contents` and applies it
|
||||
|
@ -91,7 +91,7 @@ public:
|
|||
/**
|
||||
* Resets the `overridden` flag of all Settings
|
||||
*/
|
||||
virtual void resetOverriden() = 0;
|
||||
virtual void resetOverridden() = 0;
|
||||
|
||||
/**
|
||||
* Outputs all settings to JSON
|
||||
|
@ -127,7 +127,7 @@ public:
|
|||
|
||||
MyClass() : Config(readConfigFile("/etc/my-app.conf"))
|
||||
{
|
||||
std::cout << foo << "\n"; // will print 123 unless overriden
|
||||
std::cout << foo << "\n"; // will print 123 unless overridden
|
||||
}
|
||||
};
|
||||
*/
|
||||
|
@ -163,9 +163,9 @@ public:
|
|||
|
||||
void addSetting(AbstractSetting * setting);
|
||||
|
||||
void getSettings(std::map<std::string, SettingInfo> & res, bool overridenOnly = false) override;
|
||||
void getSettings(std::map<std::string, SettingInfo> & res, bool overriddenOnly = false) override;
|
||||
|
||||
void resetOverriden() override;
|
||||
void resetOverridden() override;
|
||||
|
||||
nlohmann::json toJSON() override;
|
||||
|
||||
|
@ -184,7 +184,7 @@ public:
|
|||
|
||||
int created = 123;
|
||||
|
||||
bool overriden = false;
|
||||
bool overridden = false;
|
||||
|
||||
void setDefault(const std::string & str);
|
||||
|
||||
|
@ -215,7 +215,7 @@ protected:
|
|||
|
||||
virtual void convertToArg(Args & args, const std::string & category);
|
||||
|
||||
bool isOverriden() const { return overriden; }
|
||||
bool isOverridden() const { return overridden; }
|
||||
};
|
||||
|
||||
/* A setting of type T. */
|
||||
|
@ -252,7 +252,7 @@ public:
|
|||
|
||||
virtual void override(const T & v)
|
||||
{
|
||||
overriden = true;
|
||||
overridden = true;
|
||||
value = v;
|
||||
}
|
||||
|
||||
|
@ -324,9 +324,9 @@ struct GlobalConfig : public AbstractConfig
|
|||
|
||||
bool set(const std::string & name, const std::string & value) override;
|
||||
|
||||
void getSettings(std::map<std::string, SettingInfo> & res, bool overridenOnly = false) override;
|
||||
void getSettings(std::map<std::string, SettingInfo> & res, bool overriddenOnly = false) override;
|
||||
|
||||
void resetOverriden() override;
|
||||
void resetOverridden() override;
|
||||
|
||||
nlohmann::json toJSON() override;
|
||||
|
||||
|
|
|
@ -29,20 +29,20 @@ namespace nix {
|
|||
std::map<std::string, Config::SettingInfo> settings;
|
||||
Setting<std::string> foo{&config, value, "name-of-the-setting", "description"};
|
||||
|
||||
config.getSettings(settings, /* overridenOnly = */ false);
|
||||
config.getSettings(settings, /* overriddenOnly = */ false);
|
||||
const auto iter = settings.find("name-of-the-setting");
|
||||
ASSERT_NE(iter, settings.end());
|
||||
ASSERT_EQ(iter->second.value, "");
|
||||
ASSERT_EQ(iter->second.description, "description\n");
|
||||
}
|
||||
|
||||
TEST(Config, getDefinedOverridenSettingNotSet) {
|
||||
TEST(Config, getDefinedOverriddenSettingNotSet) {
|
||||
Config config;
|
||||
std::string value;
|
||||
std::map<std::string, Config::SettingInfo> settings;
|
||||
Setting<std::string> foo{&config, value, "name-of-the-setting", "description"};
|
||||
|
||||
config.getSettings(settings, /* overridenOnly = */ true);
|
||||
config.getSettings(settings, /* overriddenOnly = */ true);
|
||||
const auto e = settings.find("name-of-the-setting");
|
||||
ASSERT_EQ(e, settings.end());
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ namespace nix {
|
|||
|
||||
setting.assign("value");
|
||||
|
||||
config.getSettings(settings, /* overridenOnly = */ false);
|
||||
config.getSettings(settings, /* overriddenOnly = */ false);
|
||||
const auto iter = settings.find("name-of-the-setting");
|
||||
ASSERT_NE(iter, settings.end());
|
||||
ASSERT_EQ(iter->second.value, "value");
|
||||
|
@ -69,7 +69,7 @@ namespace nix {
|
|||
|
||||
ASSERT_TRUE(config.set("name-of-the-setting", "value"));
|
||||
|
||||
config.getSettings(settings, /* overridenOnly = */ false);
|
||||
config.getSettings(settings, /* overriddenOnly = */ false);
|
||||
const auto e = settings.find("name-of-the-setting");
|
||||
ASSERT_NE(e, settings.end());
|
||||
ASSERT_EQ(e->second.value, "value");
|
||||
|
@ -100,7 +100,7 @@ namespace nix {
|
|||
|
||||
{
|
||||
std::map<std::string, Config::SettingInfo> settings;
|
||||
config.getSettings(settings, /* overridenOnly = */ false);
|
||||
config.getSettings(settings, /* overriddenOnly = */ false);
|
||||
ASSERT_EQ(settings.find("key"), settings.end());
|
||||
}
|
||||
|
||||
|
@ -108,17 +108,17 @@ namespace nix {
|
|||
|
||||
{
|
||||
std::map<std::string, Config::SettingInfo> settings;
|
||||
config.getSettings(settings, /* overridenOnly = */ false);
|
||||
config.getSettings(settings, /* overriddenOnly = */ false);
|
||||
ASSERT_EQ(settings["key"].value, "value");
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Config, resetOverriden) {
|
||||
TEST(Config, resetOverridden) {
|
||||
Config config;
|
||||
config.resetOverriden();
|
||||
config.resetOverridden();
|
||||
}
|
||||
|
||||
TEST(Config, resetOverridenWithSetting) {
|
||||
TEST(Config, resetOverriddenWithSetting) {
|
||||
Config config;
|
||||
Setting<std::string> setting{&config, "", "name-of-the-setting", "description"};
|
||||
|
||||
|
@ -127,7 +127,7 @@ namespace nix {
|
|||
|
||||
setting.set("foo");
|
||||
ASSERT_EQ(setting.get(), "foo");
|
||||
config.getSettings(settings, /* overridenOnly = */ true);
|
||||
config.getSettings(settings, /* overriddenOnly = */ true);
|
||||
ASSERT_TRUE(settings.empty());
|
||||
}
|
||||
|
||||
|
@ -135,18 +135,18 @@ namespace nix {
|
|||
std::map<std::string, Config::SettingInfo> settings;
|
||||
|
||||
setting.override("bar");
|
||||
ASSERT_TRUE(setting.overriden);
|
||||
ASSERT_TRUE(setting.overridden);
|
||||
ASSERT_EQ(setting.get(), "bar");
|
||||
config.getSettings(settings, /* overridenOnly = */ true);
|
||||
config.getSettings(settings, /* overriddenOnly = */ true);
|
||||
ASSERT_FALSE(settings.empty());
|
||||
}
|
||||
|
||||
{
|
||||
std::map<std::string, Config::SettingInfo> settings;
|
||||
|
||||
config.resetOverriden();
|
||||
ASSERT_FALSE(setting.overriden);
|
||||
config.getSettings(settings, /* overridenOnly = */ true);
|
||||
config.resetOverridden();
|
||||
ASSERT_FALSE(setting.overridden);
|
||||
config.getSettings(settings, /* overriddenOnly = */ true);
|
||||
ASSERT_TRUE(settings.empty());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1590,7 +1590,7 @@ void startSignalHandlerThread()
|
|||
updateWindowSize();
|
||||
|
||||
if (sigprocmask(SIG_BLOCK, nullptr, &savedSignalMask))
|
||||
throw SysError("quering signal mask");
|
||||
throw SysError("querying signal mask");
|
||||
|
||||
sigset_t set;
|
||||
sigemptyset(&set);
|
||||
|
|
|
@ -81,7 +81,7 @@ path installables are substituted.
|
|||
|
||||
Unless `--no-link` is specified, after a successful build, it creates
|
||||
symlinks to the store paths of the installables. These symlinks have
|
||||
the prefix `./result` by default; this can be overriden using the
|
||||
the prefix `./result` by default; this can be overridden using the
|
||||
`--out-link` option. Each symlink has a suffix `-<N>-<outname>`, where
|
||||
*N* is the index of the installable (with the left-most installable
|
||||
having index 0), and *outname* is the symbolic derivation output name
|
||||
|
|
|
@ -24,7 +24,7 @@ R""(
|
|||
|
||||
This command creates a flake in the current directory by copying the
|
||||
files of a template. It will not overwrite existing files. The default
|
||||
template is `templates#defaultTemplate`, but this can be overriden
|
||||
template is `templates#defaultTemplate`, but this can be overridden
|
||||
using `-t`.
|
||||
|
||||
# Template definitions
|
||||
|
|
|
@ -70,7 +70,7 @@ Here are some examples of flake references in their URL-like representation:
|
|||
* `/home/alice/src/patchelf`: A flake in some other directory.
|
||||
* `nixpkgs`: The `nixpkgs` entry in the flake registry.
|
||||
* `nixpkgs/a3a3dda3bacf61e8a39258a0ed9c924eeca8e293`: The `nixpkgs`
|
||||
entry in the flake registry, with its Git revision overriden to a
|
||||
entry in the flake registry, with its Git revision overridden to a
|
||||
specific value.
|
||||
* `github:NixOS/nixpkgs`: The `master` branch of the `NixOS/nixpkgs`
|
||||
repository on GitHub.
|
||||
|
@ -377,7 +377,7 @@ outputs = { self, nixpkgs, grcov }: {
|
|||
};
|
||||
```
|
||||
|
||||
Transitive inputs can be overriden from a `flake.nix` file. For
|
||||
Transitive inputs can be overridden from a `flake.nix` file. For
|
||||
example, the following overrides the `nixpkgs` input of the `nixops`
|
||||
input:
|
||||
|
||||
|
|
|
@ -309,13 +309,13 @@ void mainWrapped(int argc, char * * argv)
|
|||
|
||||
if (!args.useNet) {
|
||||
// FIXME: should check for command line overrides only.
|
||||
if (!settings.useSubstitutes.overriden)
|
||||
if (!settings.useSubstitutes.overridden)
|
||||
settings.useSubstitutes = false;
|
||||
if (!settings.tarballTtl.overriden)
|
||||
if (!settings.tarballTtl.overridden)
|
||||
settings.tarballTtl = std::numeric_limits<unsigned int>::max();
|
||||
if (!fileTransferSettings.tries.overriden)
|
||||
if (!fileTransferSettings.tries.overridden)
|
||||
fileTransferSettings.tries = 0;
|
||||
if (!fileTransferSettings.connectTimeout.overriden)
|
||||
if (!fileTransferSettings.connectTimeout.overridden)
|
||||
fileTransferSettings.connectTimeout = 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,6 @@ the resulting store path and the cryptographic hash of the contents of
|
|||
the file.
|
||||
|
||||
The name component of the store path defaults to the last component of
|
||||
*url*, but this can be overriden using `--name`.
|
||||
*url*, but this can be overridden using `--name`.
|
||||
|
||||
)""
|
||||
|
|
Loading…
Reference in a new issue