Skip to content

Razkaroth/marimo-nix-starter

Repository files navigation

title emoji colorFrom colorTo sdk pinned license short_description
Marimo multi-page starter app
🍃
indigo
purple
docker
true
mit
Template for internal tools

Marimo Nix Starter

This is a starter project for building a Marimo app using Nix.

It uses uv to manage dependencies and bootstraps a marimo multi-page app via FastAPI + Docker.

The idea is to work locally with marimo and then deploy to the cloud to share results/tools as a container.

Features

  • Multi-page marimo app when containerized (see Deploying)
  • Python 3.13
  • uv for dependency management
  • Nix flake for development environment - Credit to Miklevin's JupyterLab flake.

Getting Started

  1. Clone the repository
git clone https://github.com/razkarot/marimo-nix-starter.git --depth 1 
  1. Enter the environment
nix develop

Alternatively you can install the environment using uv or pip: Create an environment

python -m venv .venv

Install dependencies

uv pip install -r requirements.txt # or pip install -r requirements.txt
  1. Run the app
marimo edit --watch

Deploying

This works by serving a asgi app via fastapi. main.py is the entrypoint for the app.

Hugging Face Spaces

Probably the easiest way to deploy is to use Hugging Face Spaces.

  1. Create a Hugging Face Space and link it.

Once you have created a Hugging Face Space, you must add the repo as a remote to your local git repo.

git remote add hf https://huggingface.co/spaces/razkarot/marimo-nix-starter
  1. Simply push your changes to the remote.
git push hf main

I ussually put both github and hugging face on the same remote so I can push to both on the same command.

Docker

You can also build and run the container locally and push it to a container based cloud service.

  1. Register pages in main.py
.with_app(path="", root="./pages/index.py")
.with_app(path="/dashboard", root="./pages/dashboard.py")
  1. Build the container
docker build -t marimo-nix-starter .
  1. Run the container
docker run -p 8000:8000 marimo-nix-starter
  1. ????

  2. Profit

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published