diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2018-09-28T13·57+0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2018-09-28T14·10+0200 |
commit | 1e7b8deea7e052ed9ebf47d1411bcaf542054b41 (patch) | |
tree | 4e04f265227ac7fcd9b52940758835e576c2978a /src/libstore/globals.hh | |
parent | 7ae7a38c9a7d0a5679e65c8213cd7b58dfdc1c52 (diff) |
Check requiredSystemFeatures for local builds
For example, this prevents a "kvm" build on machines that don't have KVM. Fixes #2012.
Diffstat (limited to 'src/libstore/globals.hh')
-rw-r--r-- | src/libstore/globals.hh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh index f589078dbb98..cf4ae63cdc2f 100644 --- a/src/libstore/globals.hh +++ b/src/libstore/globals.hh @@ -32,6 +32,8 @@ class Settings : public Config { unsigned int getDefaultCores(); + StringSet getDefaultSystemFeatures(); + public: Settings(); @@ -261,6 +263,10 @@ public: "These may be supported natively (e.g. armv7 on some aarch64 CPUs " "or using hacks like qemu-user."}; + Setting<StringSet> systemFeatures{this, getDefaultSystemFeatures(), + "system-features", + "Optional features that this system implements (like \"kvm\")."}; + Setting<Strings> substituters{this, nixStore == "/nix/store" ? Strings{"https://cache.nixos.org/"} : Strings(), "substituters", |