Skip to content

Latest commit

 

History

23 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nim Toolchain SDK for Workshop

This repository provides the nim-toolchain SDK for Workshop.

The SDK installs the Nim programming language toolchain for use inside Workshop environments.
It includes Nim and related command-line tools such as nimble, so projects can build, test, and run Nim code without manually setting up the toolchain inside each workshop.

SDK information

name:       nim-toolchain
publisher:  Seiji Matsuoka (shizuku198411)
license:    MIT

Published channels:

CHANNEL           VERSION  BASE          REV
latest/stable     2.2.10   ubuntu@24.04    1
latest/edge       2.2.10   ubuntu@24.04    1

Supported platforms

This SDK currently supports:

platforms:
  ubuntu@24.04:amd64:
  ubuntu@24.04:arm64:

Usage

Add the SDK to your workshop.yaml:

name: nim-dev
base: ubuntu@24.04

sdks:
  - name: nim-toolchain
    channel: latest/stable

Launch the workshop:

workshop launch

Then verify Nim inside the workshop:

workshop exec -- nim --version
workshop exec -- nimble --version

You can also compile and run a simple Nim program:

workshop exec -- bash -lc 'echo "echo \"hello\"" > /tmp/hello.nim && nim c -r /tmp/hello.nim'

What this SDK installs

The SDK installs:

  • Nim
  • Nimble
  • Nimsuggest, when available in the Nim distribution
  • Basic build dependencies needed for compiling Nim projects

The SDK downloads the upstream Nim binary archive based on the workshop architecture:

  • linux_x64 for amd64
  • linux_arm64 for arm64

The installed commands are exposed through $HOME/.local/bin, which is already included in the default Workshop user PATH.

Local development & tests

if you already install docker on host, before execute sdkcraft and workshop to allow lxdbr0 and workshopbr0 traffic.

sudo nft insert rule ip filter DOCKER-USER iifname workshopbr0 accept
sudo nft insert rule ip filter DOCKER-USER oifname workshopbr0 ct state related,established accept
sudo iptables -I DOCKER-USER -i lxdbr0 -j ACCEPT
sudo iptables -I DOCKER-USER -o lxdbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
sudo ip6tables -I DOCKER-USER -i lxdbr0 -j ACCEPT
sudo ip6tables -I DOCKER-USER -o lxdbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT

To build and test the SDK locally, use sdkcraft.

Try the SDK locally:

sdkcraft clean
sdkcraft try

Launch and verify:

workshop launch --verbose --wait-on-error
workshop run -- check-versions
workshop remove

Pack the SDK:

sdkcraft clean
sdkcraft pack

Repository layout

.
├── hooks
│   ├── setup-base
│   └── setup-project
├── sdkcraft.yaml
├── tests
│   ├── main
│   │   └── launch
│   │       └── task.yaml
│   └── spread.yaml
└── example
    └── workshop.yaml

License

This SDK is licensed under the MIT License. Nim itself is also distributed under the MIT License.

About

Nim Toolchain SDK for Workshop

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages