[go: up one dir, main page]

Keyboard shortcuts

Press ← or β†’ to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Sandboxes

Sandboxes / starters for different languages

It is useful for skipping most of the set-up phase ⏩ to :

  • do a kata / exercise πŸ₯‹
  • start a project πŸ—οΈ
  • test something in an isolated environment 🧫

What is in the box ? πŸ“¦

  • With a focus on reproducibility built with nix

    It is possible to use it without Nix, but reproducibility cannot be guaranteed as you may have installed an incompatible version

  • Always with sample code 🧩

  • Always with tests πŸ§ͺ

  • Trying to use standard tools depending on the ecosystem 🧰

  • Trying to have a formatter πŸͺ„

  • Trying to have a linter πŸ”Ž

Usage

Requirements

List sandboxes

NIX_CONFIG='extra-experimental-features = flakes nix-command' \
nix run 'gitlab:pinage404/nix-sandboxes#v2' -- list

Get one sandbox

NIX_CONFIG='extra-experimental-features = flakes nix-command' \
nix run 'gitlab:pinage404/nix-sandboxes#v2' -- init --path ./new_project

Optional steps

VSCode

If you want to use VSCode

  1. Install VSCode

  2. Open from the command line in the folder

    code .
    
  3. Install recommanded extensions

Cache

To avoid rebuilding things that have already been built in the pipeline, use Cachix

  1. Install Cachix

  2. Use Nix's cache

    cachix use pinage404-nix-sandboxes
    

Baby steps

If you want to use git-gamble : a tool that blends TDD (Test Driven Development) + TCR (test && commit || revert) to make sure to develop the right thing 😌, baby step by baby step πŸ‘ΆπŸ¦Ά

The tool is already included right out of the box, and tests should pass

git gamble --pass