Last active
January 18, 2025 00:28
-
-
Save vfarcic/8ebbf4943c5c012c8c98e1967fa7f33b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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
For all that want to copy-paste the
shell.nix
at 10:54 here is a slightly modified version: