Skip to content

Instantly share code, notes, and snippets.

@vfarcic
Created March 31, 2024 22:37
Show Gist options
  • Save vfarcic/96b5b06a95b1db5f9a8939a8fa850827 to your computer and use it in GitHub Desktop.
Save vfarcic/96b5b06a95b1db5f9a8939a8fa850827 to your computer and use it in GitHub Desktop.
###############################################################
# Nix for Everyone: Unleash Devbox for Simplified Development #
###############################################################
# Additional Info:
# - Devbox: https://www.jetpack.io/devbox
# - Say Goodbye to Containers - Ephemeral Environments with Nix Shell: https://youtu.be/0ulldVwZiKA
# - Say Goodbye to Makefile - Use Taskfile to Manage Tasks in CI/CD Pipelines and Locally: https://youtu.be/Z7EnwBaJzCk
#########
# Setup #
#########
# Install Devbox by following the instructions at https://www.jetpack.io/devbox/docs/installing_devbox/#install-devbox.
# Install Kyverno Chainsaw by following the instructions at https://kyverno.github.io/chainsaw/latest/install. Normally, I'd run Chainsaw as one of Nix packages but there isn't one just yet so we need to install it the "normal" way. I raised an issue so Chainsaw should soon be available as a Nix package making this installation not necessary.
git clone https://github.com/vfarcic/crossplane-sql
cd crossplane-sql
git checkout devbox
# Open a second terminal session in the same directory.
##############
# Run Devbox #
##############
which timoni
devbox shell
timoni --version
which timoni
exit
#####################################
# Search and Define Devbox Packages #
#####################################
cat devbox.json
devbox search crossplane
devbox info crossplane-cli
devbox add crossplane-cli@1.15.0
devbox rm crossplane-cli
devbox search task
devbox search go-ta
devbox search helm
devbox search kubernetes
#############################
# Working in a Devbox Shell #
#############################
cat devbox.json
devbox shell
task cluster-create
task test-watch
# Press `ctrl+c` to stop watching for changes
echo "Testing history"
exit
# Start typing `echo`
###########################
# Run Scripts with Devbox #
###########################
cat devbox.json
devbox run --list
devbox run cluster-destroy
cat .github/workflows/build.yaml
################################################################
# Using Devbox In DevContainers, Docker Containers, and DirEnv #
################################################################
devbox generate --help
devbox run -- nix-store --gc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment