Skip to content

permalik/c_sandbox

Repository files navigation

c_sandbox

sandbox:C Programming and Turnkey Ecosystem

Environment

Curricula

Environment

Development

Getting Started

Clone the repo

git clone git@github.com:permalik/c_sandbox.git

Install Nix

Enter Nix shell

nix develop

Tooling

Format and Lint

Nix Format

alejandra <target>

C Format

# Clang Format
c-format-all

C Lint

# Clang Lint
c-lint-all

# Clang Lint and Fix
c-lint-all-fix
Pre-Commit

C formatter, linter, and various Pre-Commit hooks.

Initialize

# Make script executable
sudo chmod +x precommit.sh

# Execute script
sudo ./precommit.sh

Testing

Configuration

Shell

The root .bashrc will be sourced within the shell. If changes are needed, update .bashrc and restart the shell with nix develop

CI

GitHub Actions on Push and Pull Request using Ubuntu x86_64-Linux Self-Hosted Runner

Production

# Restart Docker
orb restart docker

# Create image
docker build -t c_sandbox:dev .

# Build ephemeral container
docker run --rm c_sandbox:dev

# Destroy image
docker rmi c_sandbox:dev

Nuke

Follow instructions to purge curricula and launch a somewhat opinionated turnkey ecosystem.

Initialize purge

# Make script executable
sudo chmod +x nuke.sh

# Execute script
sudo ./nuke.sh

Update project/repository naming in various places and update the README:

  • ./.bashrc
  • Dockerfile
  • README.md
  • flake.nix

Rebuild the environment

./build.sh

Repopulate and Rerun the Build

./run.sh

Curricula

Fundamental

Construct

DataStructure

Algorithm