Skip to content

Instantly share code, notes, and snippets.

@rmetzler
Forked from vfarcic/nix.sh
Created February 12, 2024 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rmetzler/b56331de3f5be087a6e98ac912732089 to your computer and use it in GitHub Desktop.
Save rmetzler/b56331de3f5be087a6e98ac912732089 to your computer and use it in GitHub Desktop.
# Source: https://gist.github.com/vfarcic/8ebbf4943c5c012c8c98e1967fa7f33b
#####################################################################
# Say Goodbye to Containers - Ephemeral Environments with Nix Shell #
#####################################################################
# Additional Info:
# - Nix: https://nixos.org
# - Dagger: The Missing Ingredient for Your Disastrous CI/CD Pipeline: https://youtu.be/oosQ3z_9UEM
#########
# Setup #
#########
# Install `nix` by following the instructions at https://nix.dev/install-nix.
#########################################
# Ephemeral Shell Environments with Nix #
#########################################
gh repo clone vfarcic/crossplane-tutorial
nix-shell --packages gh kubectl awscli2
PS1="$ "
gh repo clone vfarcic/crossplane-tutorial
which gh
which kubectl
cd crossplane-tutorial
chmod +x setup/01-managed-resources.sh
./setup/01-managed-resources.sh
cat setup/01-managed-resources-nix.sh
chmod +x setup/01-managed-resources-nix.sh
./setup/01-managed-resources-nix.sh
# Press `ctrl+c` to stop
./setup/01-managed-resources-nix.sh
# Press `ctrl+c` to stop
exit
cd crossplane-tutorial
cat shell.nix
nix-shell
PS1="$ "
gum
./setup/01-managed-resources.sh
# Press `ctrl+c` to stop
exit
nix-shell --run $SHELL
exit
nix-store --gc
###########
# Destroy #
###########
cd ..
rm -rf crossplane-tutorial
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment