Skip to content

Neat little direnv trick #1

Description

@dragospe

Hello, thanks for this flake!

I'm working with some friends on a small project, and we've outgrow spreadsheets pretty quickly. None of us have much experience with programming notebooks (or python, or julia... I'm a haskell/scala dev personally). I'd narrowed it down between marimo and julia, so finding this repo is very fortuitous :)

I wanted to share with you a little trick that I don't see used widely. I can't take credit for it -- some former colleagues used it for a polyglot code-gen project called lambda-buffers.

Here's the technique. Let's say you want to use this template for both marimo notebooks and pluto notebooks in the same reach.

  • (1) create marimo-notebooks repo root.
  • (2) add a .envrc with use flake ..#python
  • (3) Now the python environment will be auto-loaded on entering the marimo-notebooks directory (and unloading on exiting), rather than need to change the default env or manually load with a nix develop

And this works for a second pluto-notebooks directory as well -- per-directory-root developer environments!

If this is something you'd be interested in adopting, I'd be happy to:

  • Adjust the template to give starter directories (either python, marimo-notebooks, or similar) with the .envrc present
  • Update the README explaining the technique

Cheers, and thanks again!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions