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

Add NixOS VM as runnable app .#vm with containerd and nix-snapshotter preconfigured #23

Merged
merged 3 commits into from
Aug 18, 2023

Conversation

elpdt852
Copy link
Collaborator

@elpdt852 elpdt852 commented Aug 16, 2023

Needs rebase once #21 is merged.

This lets you run a VM with just nix run .#vm! Uses the upstream containerd module + nix-snapshotter service from @rbpdt's branch in feature/nix-vm. Verified that it works.

Still has a failure with nix flake check, I assume it's not happy with the VM not having a grub device and rootfs but I'm able to run a VM just fine without it.

TODO


pkgsModule = {
_module.args.pkgs = lib.mkForce (pkgs.extend(self: super: {
inherit (packages) nix-snapshotter;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I do something pretty advanced here so don't worry about understanding every line, but essentially I'm extending nixpkgs with an overlay to add nix-snapshotter. I'm touching _module.args.pkgs here which influences the function arg pkgs that NixOS modules have access to.

TLDR; the NixOS module's pkgs now has pkgs.nix-snapshotter.

rbpdt
rbpdt previously approved these changes Aug 18, 2023
@elpdt852 elpdt852 merged commit 8fd56e0 into main Aug 18, 2023
4 checks passed
@rbpdt rbpdt deleted the feature/nixos-vm branch August 18, 2023 14:49
elpdt852 added a commit that referenced this pull request Sep 6, 2023
… preconfigured (#23)

* Add NixOS VM as runnable app .#vm with containerd and nix-snapshotter preconfigured

---------

Co-authored-by: Robbie Buxton <138501839+rbpdt@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants