-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathshell.nix
More file actions
46 lines (39 loc) · 1.17 KB
/
shell.nix
File metadata and controls
46 lines (39 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
let
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-25.11";
pkgs = import nixpkgs {
config = { };
overlays = [ ];
};
in
pkgs.mkShellNoCC {
packages = with pkgs; [
opentofu
python313Packages.ansible-core
ansible-lint
oci-cli
nixfmt-rfc-style
nil
];
OCI_TENANCY_REGION = "eu-madrid-1";
shellHook = ''
set -eu
echo '> Installing Ansible Galaxy artifacts...'
ansible-galaxy install -r requirements.yml
if [ -z "${CI:-}" ]; then
echo
echo '> Authenticating with OCI...'
oci session authenticate --profile-name terraform-aylas --region "$OCI_TENANCY_REGION"
echo
echo '> Initializing OpenTofu...'
tofu init
echo
echo 'Commands cheatsheet:'
echo ' - tofu fmt'
echo ' - tofu validate'
echo ' - tofu apply -auto-approve (create and start instances)'
echo ' - tofu destroy (stop and tear down instances)'
echo ' - tofu output aylas-one-ipv4 (get the aylas-one server public IPv4 address)'
echo " - oci session authenticate --profile-name terraform-aylas --region $OCI_TENANCY_REGION (authenticate with OCI again)"
fi
'';
}