mirror of
https://github.com/NixOS/nix.git
synced 2025-11-20 09:19:36 +01:00
Check requiredSystemFeatures for local builds
For example, this prevents a "kvm" build on machines that don't have KVM. Fixes #2012.
This commit is contained in:
parent
7ae7a38c9a
commit
1e7b8deea7
8 changed files with 79 additions and 16 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue