💭 A Brief History & Ethos of the Digital Garden
I am interested in the topic of "digital gardening", and I didn't realize how long the term has been around. As a relati
No themes match.
←→↑↓ preview · 123 tabs · Enter done
All posts
I am interested in the topic of "digital gardening", and I didn't realize how long the term has been around. As a relati
I have a use case for nesting directories with cascading .envrc files. and ran
into an issue where the parent environment was being reset by the child
environment. The fix is source_up
I manage some infrastructure at home with a folder like this:
.
├── homelab
│ ├── .envrc
│ └── stack1
│ ├── .envrc
I do this so that the “homelab-wide” terraform variables can be exported with
TF_VAR_the_variable in the homelab/.envrc and then the stack specific
variables in stack1/.envrc get exported like TF_VAR_stack_specific_var.
For example, my cloudflare account id is needed in every stack, but the cloudflare zone id is different per stack - so instead of copying the account id var to every stack (however the vars are managed), I can set it in a parent .envrc and share it in nested stack directories
# homelab/.envrc
#!/bin/bash
export VAR_FOO=BAR
So when I cd homelab I get
nic in /tmp/homelab (dev) NO PYTHON ENVIORNMENT SET
⬢ [devbox] ❯ direnv allow
direnv: loading /tmp/homelab/.envrc
direnv: export +VAR_FOO
nic in /tmp/homelab (dev) NO PYTHON ENVIORNMENT SET
⬢ [devbox] ❯ env | grep VAR
VAR_FOO=BAR
You can see VAR_FOO is set… but now I’ll cd stack1
nic in /tmp/homelab (dev) NO PYTHON ENVIORNMENT SET
⬢ [devbox] ❯ cd stack1
direnv: error /tmp/homelab/stack1/.envrc is blocked. Run `direnv allow` to approve its content
nic in /tmp/homelab/stack1 (dev) NO PYTHON ENVIORNMENT SET
⬢ [devbox] ❯ direnv allow
direnv: loading /tmp/homelab/stack1/.envrc
direnv: export +VAR_BAZ
nic in /tmp/homelab/stack1 (dev) NO PYTHON ENVIORNMENT SET
⬢ [devbox] ❯ env | grep VAR
VAR_BAZ=BAM
As you can see VAR_FOO was unset, and VAR_BAZ is set… so homelab/.envrc was blown away!
Edit stack1/.envrc with a source_up command
# stack1/.envrc # NEW
#!/bin/bash
source_up # source the parent environment
export VAR_BAZ=BAM
After the edit
nic in /tmp/homelab/stack1 (dev) NO PYTHON ENVIORNMENT SET
⬢ [devbox] ❯ vim .envrc
direnv: error /tmp/homelab/stack1/.envrc is blocked. Run `direnv allow` to approve its content
nic in /tmp/homelab/stack1 (dev) NO PYTHON ENVIORNMENT SET took 5s
⬢ [devbox] ❯ direnv allow
direnv: loading /tmp/homelab/stack1/.envrc
direnv: loading /tmp/homelab/.envrc
direnv: export +VAR_BAZ +VAR_FOO
nic in /tmp/homelab/stack1 (dev) NO PYTHON ENVIORNMENT SET
⬢ [devbox] ❯ env | grep VAR
VAR_FOO=BAR
VAR_BAZ=BAM
Both vars are set!
I needed to update some ingress rules across several AWS accounts and ran into an issue when I had to reference a securi
I have spacelift stacks managed with open tofu and stacks managed with terraform... Due to this very issue I think, I ra
A recent Snowflake issue borked some old pipelines - thankfully it appears to be a simple fix. Just goes to show you tha
Someday I will build a thing to see the relationship in my posts and notes. Right now I'm working on writing consistentl
My brother asked me to generate some QR codes for his link page that I manage. It's been a long time since I've used SD
| j | Scroll down |
| k | Scroll up |
| g g | Scroll to top |
| Shift G | Scroll to bottom |
| d | Half-page down |
| u | Half-page up |
| j / ↓ | Next post (in feeds) |
| k / ↑ | Previous post (in feeds) |
| Enter / o | Open highlighted post |
| Shift O | Open in new tab |
| g h | Go to home |
| g s | Focus search |
| [ / Shift K | Previous post in series (or previous page) |
| ] / Shift J | Next post in series (or next page) |
| b | Toggle left sidebar |
| Shift B | Toggle right sidebar |
| s | Toggle reader mode (posts) / simple/rich view (feeds) |
| t | Open theme picker |
| , / . | Previous / Next theme |
| < / > | Previous / Next style |
| F / f | Previous / Next font |
| \ | Toggle dark/light mode |
| / | Focus search input |
| ⌘CtrlK | Focus search (alternative) |
| y y | Copy URL to clipboard |
| ? | Show this help |
| Esc | Close / clear highlight |