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
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
Online with GitPod
On you own machine
Requirements
- Install Nix
- Preferably with
nix-installer
- Preferably with
- Install DirEnv
- Install Git
List sandboxes
export NIX_CONFIG='extra-experimental-features = flakes nix-command'
nix run 'gitlab:pinage404/nix-sandboxes'
Get one sandbox
e.g. for Rust
export NIX_CONFIG='extra-experimental-features = flakes nix-command'
nix run 'gitlab:pinage404/nix-sandboxes' rust ./your_new_project_directory
Optional steps
VSCode
If you want to use VSCode
-
Install VSCode
-
Open from the command line in the folder
code . -
Install recommanded extensions
- Prefer a video ? Watch the video tutorial
Cache
To avoid rebuilding things that have already been built elsewhere, use Cachix
-
Install Cachix
-
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
C with formatting and test
β οΈ Gitpod will open the root folder
Due to some limitations of Gitpod, we cannot simply open a sub-folder
Opening in Gitpod will open the root folder
Two terminals will be opened :
- the first in the root folder
- the second in the target folder
Both terminals automatically load the environment of their current folder

Or with Nix
NIX_CONFIG="extra-experimental-features = flakes nix-command" \
nix flake new --template "gitlab:pinage404/nix-sandboxes#c" ./your_new_project_directory
Or just execute
mask help
Unity testing framework
Clojure with formatting, linting and test
β οΈ Gitpod will open the root folder
Due to some limitations of Gitpod, we cannot simply open a sub-folder
Opening in Gitpod will open the root folder
Two terminals will be opened :
- the first in the root folder
- the second in the target folder
Both terminals automatically load the environment of their current folder

Or with Nix
NIX_CONFIG="extra-experimental-features = flakes nix-command" \
nix flake new --template "gitlab:pinage404/nix-sandboxes#clojure" ./your_new_project_directory
Or just execute
mask help
Common Lisp with formatting and test
β οΈ Gitpod will open the root folder
Due to some limitations of Gitpod, we cannot simply open a sub-folder
Opening in Gitpod will open the root folder
Two terminals will be opened :
- the first in the root folder
- the second in the target folder
Both terminals automatically load the environment of their current folder

Or with Nix
NIX_CONFIG="extra-experimental-features = flakes nix-command" \
nix flake new --template "gitlab:pinage404/nix-sandboxes#common_lisp" ./your_new_project_directory
Or just execute
mask help
Learn Common Lisp in Y Minutes
C++ with formatting and test
β οΈ Gitpod will open the root folder
Due to some limitations of Gitpod, we cannot simply open a sub-folder
Opening in Gitpod will open the root folder
Two terminals will be opened :
- the first in the root folder
- the second in the target folder
Both terminals automatically load the environment of their current folder

Or with Nix
NIX_CONFIG="extra-experimental-features = flakes nix-command" \
nix flake new --template "gitlab:pinage404/nix-sandboxes#cpp" ./your_new_project_directory
Or just execute
mask help
ELM with formatting, linting and test
β οΈ Gitpod will open the root folder
Due to some limitations of Gitpod, we cannot simply open a sub-folder
Opening in Gitpod will open the root folder
Two terminals will be opened :
- the first in the root folder
- the second in the target folder
Both terminals automatically load the environment of their current folder

Or with Nix
NIX_CONFIG="extra-experimental-features = flakes nix-command" \
nix flake new --template "gitlab:pinage404/nix-sandboxes#elm" ./your_new_project_directory
Or just execute
mask help
Erlang with formatting and test
β οΈ Gitpod will open the root folder
Due to some limitations of Gitpod, we cannot simply open a sub-folder
Opening in Gitpod will open the root folder
Two terminals will be opened :
- the first in the root folder
- the second in the target folder
Both terminals automatically load the environment of their current folder

Or with Nix
NIX_CONFIG="extra-experimental-features = flakes nix-command" \
nix flake new --template "gitlab:pinage404/nix-sandboxes#erlang" ./your_new_project_directory
Or just execute
mask help
Forth with test
β οΈ Gitpod will open the root folder
Due to some limitations of Gitpod, we cannot simply open a sub-folder
Opening in Gitpod will open the root folder
Two terminals will be opened :
- the first in the root folder
- the second in the target folder
Both terminals automatically load the environment of their current folder

Or with Nix
NIX_CONFIG="extra-experimental-features = flakes nix-command" \
nix flake new --template "gitlab:pinage404/nix-sandboxes#forth" ./your_new_project_directory
Or just execute
mask help
F# with format, lint and test
β οΈ Gitpod will open the root folder
Due to some limitations of Gitpod, we cannot simply open a sub-folder
Opening in Gitpod will open the root folder
Two terminals will be opened :
- the first in the root folder
- the second in the target folder
Both terminals automatically load the environment of their current folder

Or with Nix
nix flake new --template "gitlab:pinage404/nix-sandboxes#fsharp" ./your_new_project_directory
Or just execute
mask help
Go with formatting and test
β οΈ Gitpod will open the root folder
Due to some limitations of Gitpod, we cannot simply open a sub-folder
Opening in Gitpod will open the root folder
Two terminals will be opened :
- the first in the root folder
- the second in the target folder
Both terminals automatically load the environment of their current folder

Or with Nix
NIX_CONFIG="extra-experimental-features = flakes nix-command" \
nix flake new --template "gitlab:pinage404/nix-sandboxes#go" ./your_new_project_directory
Or just execute
mask help
Haskell with formatting, linting and test
β οΈ Gitpod will open the root folder
Due to some limitations of Gitpod, we cannot simply open a sub-folder
Opening in Gitpod will open the root folder
Two terminals will be opened :
- the first in the root folder
- the second in the target folder
Both terminals automatically load the environment of their current folder

Or with Nix
NIX_CONFIG="extra-experimental-features = flakes nix-command" \
nix flake new --template "gitlab:pinage404/nix-sandboxes#haskell" ./your_new_project_directory
Or just execute
mask help
Nix with formatting, linting and test
β οΈ Gitpod will open the root folder
Due to some limitations of Gitpod, we cannot simply open a sub-folder
Opening in Gitpod will open the root folder
Two terminals will be opened :
- the first in the root folder
- the second in the target folder
Both terminals automatically load the environment of their current folder

Or with Nix
NIX_CONFIG="extra-experimental-features = flakes nix-command" \
nix flake new --template "gitlab:pinage404/nix-sandboxes#nix" ./your_new_project_directory
Or just execute
mask help
PHP with linting and test
β οΈ Gitpod will open the root folder
Due to some limitations of Gitpod, we cannot simply open a sub-folder
Opening in Gitpod will open the root folder
Two terminals will be opened :
- the first in the root folder
- the second in the target folder
Both terminals automatically load the environment of their current folder

Or with Nix
NIX_CONFIG="extra-experimental-features = flakes nix-command" \
nix flake new --template "gitlab:pinage404/nix-sandboxes#php" ./your_new_project_directory
Or just execute
mask help
Prolog with test
β οΈ Gitpod will open the root folder
Due to some limitations of Gitpod, we cannot simply open a sub-folder
Opening in Gitpod will open the root folder
Two terminals will be opened :
- the first in the root folder
- the second in the target folder
Both terminals automatically load the environment of their current folder

Or with Nix
NIX_CONFIG="extra-experimental-features = flakes nix-command" \
nix flake new --template "gitlab:pinage404/nix-sandboxes#prolog" ./your_new_project_directory
Or just execute
mask help
Python with formatting, typing and test
β οΈ Gitpod will open the root folder
Due to some limitations of Gitpod, we cannot simply open a sub-folder
Opening in Gitpod will open the root folder
Two terminals will be opened :
- the first in the root folder
- the second in the target folder
Both terminals automatically load the environment of their current folder

Or with Nix
NIX_CONFIG="extra-experimental-features = flakes nix-command" \
nix flake new --template "gitlab:pinage404/nix-sandboxes#python" ./your_new_project_directory
Or just execute
mask help
Roc lang
Roc is under construction, not even in alpha stage. It's an attempt to create a backend language inspired by the simplicity of Elm.
There is currently no editor, syntax highlighter or language server. The coffee script highlighter works a little.
You can checkout the tutorial
Use this template
β οΈ Gitpod will open the root folder
Due to some limitations of Gitpod, we cannot simply open a sub-folder
Opening in Gitpod will open the root folder
Two terminals will be opened :
- the first in the root folder
- the second in the target folder
Both terminals automatically load the environment of their current folder

Or with Nix
NIX_CONFIG="extra-experimental-features = flakes nix-command" \
nix flake new --template "gitlab:pinage404/nix-sandboxes#roc" ./your_new_project_directory
Or just execute
mask help
Rockstar with snapshot testing
Also known as Golden Master Testing
β οΈ Gitpod will open the root folder
Due to some limitations of Gitpod, we cannot simply open a sub-folder
Opening in Gitpod will open the root folder
Two terminals will be opened :
- the first in the root folder
- the second in the target folder
Both terminals automatically load the environment of their current folder

Or with Nix
NIX_CONFIG="extra-experimental-features = flakes nix-command" \
nix flake new --template "gitlab:pinage404/nix-sandboxes#rockstar" ./your_new_project_directory
Or just execute
mask help
Ruby with test
β οΈ Gitpod will open the root folder
Due to some limitations of Gitpod, we cannot simply open a sub-folder
Opening in Gitpod will open the root folder
Two terminals will be opened :
- the first in the root folder
- the second in the target folder
Both terminals automatically load the environment of their current folder

Or with Nix
NIX_CONFIG="extra-experimental-features = flakes nix-command" \
nix flake new --template "gitlab:pinage404/nix-sandboxes#ruby" ./your_new_project_directory
Or just execute
mask help
Learn Ruby ecosystem in Y Minutes
Rust with formatting, linting and test
β οΈ Gitpod will open the root folder
Due to some limitations of Gitpod, we cannot simply open a sub-folder
Opening in Gitpod will open the root folder
Two terminals will be opened :
- the first in the root folder
- the second in the target folder
Both terminals automatically load the environment of their current folder

Or with Nix
NIX_CONFIG="extra-experimental-features = flakes nix-command" \
nix flake new --template "gitlab:pinage404/nix-sandboxes#rust" ./your_new_project_directory
Or just execute
mask help
Bash with formatting, linting and test
β οΈ Gitpod will open the root folder
Due to some limitations of Gitpod, we cannot simply open a sub-folder
Opening in Gitpod will open the root folder
Two terminals will be opened :
- the first in the root folder
- the second in the target folder
Both terminals automatically load the environment of their current folder

Or with Nix
NIX_CONFIG="extra-experimental-features = flakes nix-command" \
nix flake new --template "gitlab:pinage404/nix-sandboxes#shell" ./your_new_project_directory
Or just execute
mask help
Small wrapper for snapshot testing
Also known as Golden Master Testing
β οΈ Gitpod will open the root folder
Due to some limitations of Gitpod, we cannot simply open a sub-folder
Opening in Gitpod will open the root folder
Two terminals will be opened :
- the first in the root folder
- the second in the target folder
Both terminals automatically load the environment of their current folder

Or with Nix
NIX_CONFIG="extra-experimental-features = flakes nix-command" \
nix flake new --template "gitlab:pinage404/nix-sandboxes#snapshot_testing" ./your_new_project_directory
In .envrc change the SNAPSHOT_TEST_COMMAND with your actual test command
export SNAPSHOT_TEST_COMMAND="sh ./bin/hello" # change this
Or just execute
mask help
Typescript
There is several Typescript sandboxes because they use different runtime nor test frameworks
TypeScript with formatting and test on Bun
β οΈ Gitpod will open the root folder
Due to some limitations of Gitpod, we cannot simply open a sub-folder
Opening in Gitpod will open the root folder
Two terminals will be opened :
- the first in the root folder
- the second in the target folder
Both terminals automatically load the environment of their current folder

Or with Nix
NIX_CONFIG="extra-experimental-features = flakes nix-command" \
nix flake new --template "gitlab:pinage404/nix-sandboxes#typescript_bun" ./your_new_project_directory
Or just execute
mask help
Awesome Node.JS not Bun but still accurate
TypeScript with formatting, linting and test on Deno
β οΈ Gitpod will open the root folder
Due to some limitations of Gitpod, we cannot simply open a sub-folder
Opening in Gitpod will open the root folder
Two terminals will be opened :
- the first in the root folder
- the second in the target folder
Both terminals automatically load the environment of their current folder

Or with Nix
NIX_CONFIG="extra-experimental-features = flakes nix-command" \
nix flake new --template "gitlab:pinage404/nix-sandboxes#typescript_deno" ./your_new_project_directory
Or just execute
mask help
Awesome Node.JS not Deno but still accurate
TypeScript with formatting and test with Jest on NodeJS
β οΈ Gitpod will open the root folder
Due to some limitations of Gitpod, we cannot simply open a sub-folder
Opening in Gitpod will open the root folder
Two terminals will be opened :
- the first in the root folder
- the second in the target folder
Both terminals automatically load the environment of their current folder

Or with Nix
NIX_CONFIG="extra-experimental-features = flakes nix-command" \
nix flake new --template "gitlab:pinage404/nix-sandboxes#typescript_node_jest" ./your_new_project_directory
Or just execute
mask help
TypeScript with formatting and test with Vitest on NodeJS
β οΈ Gitpod will open the root folder
Due to some limitations of Gitpod, we cannot simply open a sub-folder
Opening in Gitpod will open the root folder
Two terminals will be opened :
- the first in the root folder
- the second in the target folder
Both terminals automatically load the environment of their current folder

Or with Nix
NIX_CONFIG="extra-experimental-features = flakes nix-command" \
nix flake new --template "gitlab:pinage404/nix-sandboxes#typescript_node_vitest" ./your_new_project_directory
Or just execute
mask help
Tool comparison table
Give Love β€οΈ nor Give Feedbacks π£οΈ
Do you like this project ?
- If yes, please add a star on GitLab
- If no, please open an issue to give your feedbacks
Contributing
Any contributions (feedback, bug report, merge request ...) are welcome
Adding a language
Commit message format
Commit message should be <language>: <a descriptive message>
- prefix your commit with
<language>:the name of the folderall:when (almost) every languages are touchedmeta:when it is about the project itselfbase:when it touch the root folder
Steps
- copy an existing folder (e.g.
shell) - name the folder with the language
- adapt it
- in
<language>/flake.nix, in thepackages, add every dependencies needed mask <target>must return 0 code on success, non 0 on fail- complete the
<language>/maskfile.mdwithmask testmask lintif possiblemask formatif possiblemask runif possiblemask runshould displayHello worldmask run --name fooshould displayHello foo
mask installif there is specific steps to do manually such as pulling dependenciesmask updateif there is specific steps to update the language and dependencies
- in
<language>/.config/git/hooks/pre-gamble, keepmask formatif possiblemask lintif possible
- in
<language>/flake.nix, change thedescription - in
<language>/README.md, change the title - in
<language>/README.md, change<language>- in the URL
- in the flake command
- in
- add an usage example of the language
- using TDD
- or even better using TCRDD (e.g. using
git-gamble)
- or even better using TCRDD (e.g. using
hellowithout argument or an optionnal (none) or empty string (depending on the language possibility) should outputHello worldhellowithfooargument as string should outputHello foo- if you are a beginner with this language you may need to look at help with language
- using TDD
- in
flake.nix, in thetemplatessection, add the new template - in
.gitlab-ci.yml, in theLANGUAGElist, add the new language
Put the same description in
flake.nix'sdescription<language>/flake.nix'sdescription<language>/README.mdtitle
VSCode support
- in
<language>/.vscode/extension.json, add needed extensions
Document it
-
in
.docs/tool_comparison_table.mdtable, add a row for the new language -
add a symbolic link between the
<language>/README.mdand the documentationln -s ../../<language>/README.md ./.docs/sandboxes/<language>.md -
in
.docs/SUMMARY.md, add a markdwon link to./sandboxes/<language>.md
Exercices / Katas
List of exercices / katas
- Awesome Katas
- Kata Log
- List of excercices
- from cyber-dojo
- Samman Technical Coaching's Katas
- Emily Bache's Katas
- Coding Dojo's Katas
- Xavier Nopre's Katas
Help with languages
List of tools to help writing in some language
- Learn X in Y Minutes
- Programming-Idioms
- Syntax Cheatsheet for Javascript/Python
- Awesome Lists curated lists of links related to a topic
- Hello, World! in different languages on Wikipedia
- Rosetta Code same programs in many languages
- The Algorithms many algorithms in many languages
Others Bootstraps
List of alternatives bootstraps / setup / template with more languages
- kata-bootstraps of Softwerkskammer Berlin
- List of setup
- from cyber-dojo
- DevBox which is used by this repository
- NixOS's templates
- DevEnv
- DevShell
- Flox
- CodeWorks' Katapult
- More on Awesome Nix