Skip to content

Add bubblewrap support for running nix2gpu without a container runtime#12

Open
baileylu121 wants to merge 12 commits intomainfrom
baileylu/bubblewrap
Open

Add bubblewrap support for running nix2gpu without a container runtime#12
baileylu121 wants to merge 12 commits intomainfrom
baileylu/bubblewrap

Conversation

@baileylu121
Copy link
Collaborator

@baileylu121 baileylu121 commented Jan 29, 2026

Add bubblewrap support for running nix2gpu without a container runtime

This PR updates the flake dependencies and switches from the baileylu/minimize-flake branch to the baileylu/bubblewrap branch of nimi.

Allow creation of the template

Adds a templates module and renames the basic template to default, making it available via nix flake init -t github:weyl-ai/nix2gpu.

Fix typo

Fixes a missing colon in the getting-started.md documentation.

Bind to nimi's bubblewrap with equivalency to the container config

Adds bubblewrap configuration to match container behavior, allowing nix2gpu containers to run in bubblewrap sandboxes. This includes:

  • Setting up filesystem binds for copyToRoot packages
  • Configuring GPU device access
  • Ensuring proper environment variables
  • Updating the startup script to handle bubblewrap environments

Optimize the calling to only evaluate the nimi module once

Refactors the container creation to evaluate the nimi module once and reuse the configuration for both container image and bubblewrap.

Properly bind gpu drivers

Adds comprehensive GPU device bindings for NVIDIA devices and configures the proper procfs access needed for GPU drivers to function in bubblewrap.


Note

Medium Risk
Touches core container build/startup paths and bumps key flake dependencies (including nixpkgs and nimi), which can affect runtime behavior and compatibility across environments.

Overview
Adds bubblewrap mode support so nix2gpu instances can run via a new runInBubblewrap wrapper without Docker/Podman, including automatic copyToRoot bind-mounting, env/user/working-dir translation, and extensive NVIDIA library/device + /proc handling.

Updates startup/init behavior for bubblewrap (tmpfs dirs, populating /etc, SSH port rewrite to 2222, root auth handling), adds a NixOS check to exercise bubblewrap execution, and tweaks the container-runtime check to expose SSH. Documentation is expanded with a new docs/bubblewrap.md, and the repo adds a flake.templates.default template plus bumps nixpkgs/nimi (switching to baileylu/bubblewrap) and other flake inputs.

Written by Cursor Bugbot for commit d27b0b8. This will update automatically on new commits. Configure here.

Copy link
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@baileylu121 baileylu121 changed the title nix flake update + switch nimi feature branch Add bubblewrap support for running containers without Docker Jan 29, 2026
@github-actions
Copy link

github-actions bot commented Jan 29, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://fleek-sh.github.io/nix2gpu/pr-preview/pr-12/

Built to branch gh-pages at 2026-02-01 17:42 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@baileylu121 baileylu121 changed the title Add bubblewrap support for running containers without Docker Add bubblewrap support for running nix2gpu without a container runtime Jan 29, 2026
@baileylu121 baileylu121 marked this pull request as ready for review January 29, 2026 19:17
@baileylu121 baileylu121 requested a review from b7r6 January 29, 2026 19:17
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

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.

1 participant