Skip to content

Commit 8c19ec8

Browse files
committedSep 20, 2024
flake: open nix flake devShell automatically with direnv (nix-direnv)
see infra-templates: - 32a8552eaf0347c217fa7d80572b06d5cd90243d - a1b9500b5dcd114d45571e8122459f0e5aca9de2 Signed-off-by: Alexis Pentori <[email protected]>
1 parent 40b780c commit 8c19ec8

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed
 

‎.envrc

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
export VAULT_CACERT=./ansible/files/vault-ca.crt
2-
export VAULT_CLIENT_CERT=./ansible/files/vault-client-user.crt
3-
export VAULT_CLIENT_KEY=./ansible/files/vault-client-user.key
4-
export CONSUL_HTTP_TOKEN=$(pass services/consul/tokens/terraform)
1+
if ! has nix_direnv_version || ! nix_direnv_version 3.0.6; then
2+
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.6/direnvrc" "sha256-RYcUJaRMf8oF5LznDrlCXbkOQrywm0HDv1VjYGaJGdM="
3+
fi
4+
5+
source .envrc.secrets
6+
use flake

‎.envrc.secrets

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export VAULT_CACERT=./ansible/files/vault-ca.crt
2+
export VAULT_CLIENT_CERT=./ansible/files/vault-client-user.crt
3+
export VAULT_CLIENT_KEY=./ansible/files/vault-client-user.key
4+
export VAULT_ADDR=https://vault-api.infra.status.im:8200
5+
export CONSUL_HTTP_TOKEN=$(pass services/consul/tokens/terraform)

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*.tfstate.d/
55
*.tfstate.backup
66
*.retry
7+
.direnv/
78

89
ansible/files/*
910
__pycache__

‎flake.nix

-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@
4040
shellHook = ''
4141
./ansible/roles.py --check || \
4242
echo -e '\nWARNING: Your role versions appear to be incorrect!' >&2
43-
eval "$(direnv hook bash)"
44-
direnv allow .
4543
'';
4644
};
4745
});

0 commit comments

Comments
 (0)