aboutsummaryrefslogtreecommitdiff
path: root/scripts/infra.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--scripts/infra.nix (renamed from nix/scripts/common.nix)12
1 files changed, 5 insertions, 7 deletions
diff --git a/nix/scripts/common.nix b/scripts/infra.nix
index b457ea2..aa9b0d6 100644
--- a/nix/scripts/common.nix
+++ b/scripts/infra.nix
@@ -1,4 +1,4 @@
-{ pkgs }:
+{ self, pkgs }:
let
tofuSetup = ''
tofu_setup() {
@@ -22,13 +22,13 @@ let
# Install terraform configs
${pkgs.coreutils}/bin/install -Dm 0644 ${
- import ../tofu/backups.nix {
+ import "${self}/infra/tf/backups.nix" {
inherit pkgs;
}
} "$TMPDIR/backups/backups.tf.json"
${pkgs.coreutils}/bin/install -Dm 0644 ${
- import ../tofu/dns.nix {
+ import "${self}/infra/tf/dns.nix" {
inherit pkgs;
}
} "$TMPDIR/cloudflare/cloudflare-dns.tf.json"
@@ -43,8 +43,6 @@ let
'';
in
[
- (pkgs.writeScriptBin "update-deps" "nix flake update --commit-lock-file")
-
(pkgs.writeShellScriptBin "gcloud-auth" ''
set -xeuo pipefail
${pkgs.google-cloud-sdk}/bin/gcloud auth print-identity-token > /dev/null 2>&1 || \
@@ -53,7 +51,7 @@ in
${pkgs.google-cloud-sdk}/bin/gcloud auth application-default login --quiet
'')
- (pkgs.writeShellScriptBin "tofu-plan" ''
+ (pkgs.writeShellScriptBin "tf-plan" ''
set -xeuo pipefail
${tofuSetup}
@@ -66,7 +64,7 @@ in
CLOUDFLARE_API_TOKEN="$CLOUDFLARE_API_TOKEN" ${pkgs.opentofu}/bin/tofu -chdir="$TMPDIR/cloudflare" plan
'')
- (pkgs.writeShellScriptBin "tofu-apply" ''
+ (pkgs.writeShellScriptBin "tf-apply" ''
set -xeuo pipefail
${tofuSetup}