Skip to content

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

Merged
Ericson2314 merged 2 commits intoNixOS:masterfrom
hercules-ci:issue-7619-apple-virt-system-feature
Oct 20, 2023
Merged

libstore: Add apple-virt to system features when available#9187
Ericson2314 merged 2 commits intoNixOS:masterfrom
hercules-ci:issue-7619-apple-virt-system-feature

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 requested a review from thufschmitt as a code owner October 19, 2023 15:03
@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
@Ericson2314 Ericson2314 merged commit 8a28ed2 into NixOS:master Oct 20, 2023
@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


- `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

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

Comments