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

libstore: Add apple-virt to system features when available #9187

Merged

Conversation

roberth
Copy link
Member

@roberth roberth commented Oct 19, 2023

I'm sure that we'll adjust the implementation over time, but this at least discerns between an apple silicon bare metal machine and a tart VM.
I haven't named the system feature after a specific technology except "apple", because the way this is checked does not seem specific to hvf or avf, as far as I know.

Motivation

VMs often don't support nested virtualization. When macOS itself is virtualized, most likely it does not support hardware virtualization for its guests.

Context

Priorities

Add 👍 to pull requests you find important.

@roberth roberth changed the title libstore: Add apple-virt to system features when available libstore: Add apple-virt to system features when available Oct 19, 2023
@roberth roberth added the macos Nix on macOS, aka OS X, aka darwin label Oct 19, 2023
Copy link
Member

@Ericson2314 Ericson2314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, would be very nice to have this feature!

Just needs change log and docs (I think we've been forgetting about these since the checklist went away...)

I'm sure that we'll adjust the implementation over time, but this
at least discerns between an apple silicon bare metal machine and
a tart VM.
@roberth roberth force-pushed the issue-7619-apple-virt-system-feature branch from 65c6ac3 to bb645c5 Compare October 20, 2023 08:21
@roberth roberth added the backport 2.18-maintenance Automatically creates a PR against the branch label Oct 20, 2023
@Ericson2314 Ericson2314 merged commit 8a28ed2 into NixOS:master Oct 20, 2023
9 checks passed
@github-actions
Copy link

Backport failed for 2.18-maintenance, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally.

git fetch origin 2.18-maintenance
git worktree add -d .worktree/backport-9187-to-2.18-maintenance origin/2.18-maintenance
cd .worktree/backport-9187-to-2.18-maintenance
git checkout -b backport-9187-to-2.18-maintenance
ancref=$(git merge-base e58566a057692bbfbd30a6639248adfcf81df108 bb645c5d02025158c8dbb0c2a60e7cba8251f062)
git cherry-pick -x $ancref..bb645c5d02025158c8dbb0c2a60e7cba8251f062

@@ -714,9 +714,13 @@ public:

System features are user-defined, but Nix sets the following defaults:

- `apple-virt`

Included on darwin if virtualization is available.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Included on darwin if virtualization is available.
Included on Darwin if virtualization is available.

roberth added a commit that referenced this pull request Nov 16, 2023
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/getting-nixos-to-work-macos-m1-2-3-aarch64-darwin/39510/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.18-maintenance Automatically creates a PR against the branch macos Nix on macOS, aka OS X, aka darwin
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Automatically add apple virtualization to system-features
4 participants