flake: add direnv to load vault variables

Signed-off-by: Alexis Pentori <alexis@status.im>
This commit is contained in:
Alexis Pentori 2024-08-09 12:03:05 +02:00
parent c1b14ab9b5
commit 06b8e8067d
No known key found for this signature in database
GPG Key ID: 65250D2801E47A10
2 changed files with 7 additions and 1 deletions

4
.envrc Normal file
View File

@ -0,0 +1,4 @@
export VAULT_CACERT=./ansible/files/vault-ca.crt
export VAULT_CLIENT_CERT=./ansible/files/vault-client-user.crt
export VAULT_CLIENT_KEY=./ansible/files/vault-client-user.key
export CONSUL_HTTP_TOKEN=$(pass services/consul/tokens/terraform)

View File

@ -25,7 +25,7 @@
in pkgs.mkShellNoCC { in pkgs.mkShellNoCC {
packages = with pkgs.buildPackages; [ packages = with pkgs.buildPackages; [
# misc # misc
git openssh jq fzf silver-searcher git openssh jq fzf silver-searcher direnv
# networking # networking
curl nmap nettools dnsutils curl nmap nettools dnsutils
# infra # infra
@ -40,6 +40,8 @@
shellHook = '' shellHook = ''
./ansible/roles.py --check || \ ./ansible/roles.py --check || \
echo -e '\nWARNING: Your role versions appear to be incorrect!' >&2 echo -e '\nWARNING: Your role versions appear to be incorrect!' >&2
eval "$(direnv hook bash)"
direnv allow .
''; '';
}; };
}); });