Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically add apple virtualization to system-features #7619

Closed
roberth opened this issue Jan 17, 2023 · 0 comments · Fixed by #9187
Closed

Automatically add apple virtualization to system-features #7619

roberth opened this issue Jan 17, 2023 · 0 comments · Fixed by #9187
Labels
feature Feature request or proposal macos Nix on macOS, aka OS X, aka darwin

Comments

@roberth
Copy link
Member

roberth commented Jan 17, 2023

Is your feature request related to a problem? Please describe.

MacOS has two virtualization frameworks. By introducing these feature labels we allow for machines without such support to join a build farm.

Describe the solution you'd like

Add system-features = nixos-test to the default/example configuration and add "hvf" and "avf" dynamically based on whether these technologies are available, similar to how we do it for "kvm".

Describe alternatives you've considered

Additional context

Most MacOS systems support virtualization, but this is not a given.

AVF: https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_virtualization

nix/src/libstore/globals.cc

Lines 126 to 143 in fb8fc6f

StringSet Settings::getDefaultSystemFeatures()
{
/* For backwards compatibility, accept some "features" that are
used in Nixpkgs to route builds to certain machines but don't
actually require anything special on the machines. */
StringSet features{"nixos-test", "benchmark", "big-parallel"};
#if __linux__
features.insert("uid-range");
#endif
#if __linux__
if (access("/dev/kvm", R_OK | W_OK) == 0)
features.insert("kvm");
#endif
return features;
}

Priorities

Add 👍 to issues you find important.

@roberth roberth added feature Feature request or proposal macos Nix on macOS, aka OS X, aka darwin labels Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request or proposal macos Nix on macOS, aka OS X, aka darwin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant