-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Nix in Darwin #20
base: master
Are you sure you want to change the base?
Nix in Darwin #20
Conversation
Otherwhise it doesn't fetch the image
@@ -5,7 +5,7 @@ | |||
let | |||
diskSize = if diskSizeBytes < 40000000000 then throw "diskSizeBytes ${toString diskSizeBytes} too small for macOS" else diskSizeBytes; | |||
|
|||
installAssistant-fetched = import <nix/fetchurl.nix> { | |||
installAssistant-fetched = fetchurl { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to drop this, it's here just for my convenience. Without it I cannot fetch the image, don't know why but it's not related to the PR's goal.
@roberth talked about a potential "builder-from-derivation", for Nix which would allow specifying a builder as part of a derivation. I don't see many other solutions to this problem today otherwise. |
A NixOS test could work, if nested KVM virtualisation is supported and enabled on the host. -${toplevel}/bin/switch-to-configuration
+$(nix-store -r ${toplevel.drvPath})/bin/switch-to-configuration (so to speak)
Not sure if that was a good idea tbh. |
This adds an optionally executed (idempotent) script at the VM boot that installs Nix using the Determinate Systems' Nix installer and builds and activates a given
nix-darwin
config (it's also possible installing only Nix without thenix-darwin
configuration).It also adds the needed options in the module. I've been testing it on my NixOS machine with these options:
This is just a draft, I was considering the following improvements:
nix-darwin
configuration is evaluated externally and itsdrv
closure is copied to the VM. At that point the build happens insidedarwin
(otherwise we would need a darwin builder externally) and it may require internet. It should be possible copying both the drv closures and the fixed output realisations from that closure, this way it should be possible building (and activating) the darwin config at build time (build time for the host!). Anyway this would require fetching much more paths than directly building the config on darwin.nix-darwin
configuration? We would need to copy the realisations closure for adarwin
config i.e. we would need adarwin
builder to run the tests.