Skip to content

A minimalist nix flake enabled devcontainer image with Devbox and Direnv.

Notifications You must be signed in to change notification settings

aloshy-ai/nixcontainer

Repository files navigation

NIXCONTAINER

Platform Build Status License

Usage

ghcr.io/aloshy-ai/nixcontainer:latest

Add this to your .devcontainer/devcontainer.json:

{
  "image": "ghcr.io/aloshy-ai/nixcontainer:latest",
  "workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
  "workspaceFolder": "/workspace"
}

The container is configured with /workspace as the default working directory and mount point for your project files. This ensures:

  • Your local files are mounted into the container at /workspace
  • VS Code opens directly in your project directory
  • All development tools work with the correct file paths

Getting Started

This project uses devbox to manage its development environment.

Install devbox:

curl -fsSL https://get.jetpack.io/devbox | bash

Start the devbox shell:

devbox shell

Run a script in the devbox environment:

devbox run <script>

Scripts

Scripts are custom commands that can be run using this project's environment. This project has the following scripts:

Shell Init Hook

The Shell Init Hook is a script that runs whenever the devbox environment is instantiated. It runs on devbox shell and on devbox run.

gh auth status &>/dev/null || gh auth login
export GITHUB_TOKEN=$(gh auth token)
export GITHUB_USERNAME=$(gh api user | jq -r .login)
echo "▄▀█ █░░ █▀█ █▀ █░█ █▄░█ ░ ▄▀█ █
█▀█ █▄▄ █▄█ ▄█ █▀█ █░▀█ ▄ █▀█ █"
devbox run --list

Packages

Script Details

devbox run build

nix build

devbox run load

nix build .#loadImage && ./result/bin/load-image

devbox run push

nix build .#pushToGhcr && GITHUB_USERNAME=$GITHUB_USERNAME GITHUB_TOKEN=$GITHUB_TOKEN ./result/bin/push-to-ghcr

About

A minimalist nix flake enabled devcontainer image with Devbox and Direnv.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages