about summary refs log tree commit diff
path: root/tools/dnsupdate/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'tools/dnsupdate/default.nix')
-rw-r--r--tools/dnsupdate/default.nix19
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/dnsupdate/default.nix b/tools/dnsupdate/default.nix
new file mode 100644
index 0000000..b8201c0
--- /dev/null
+++ b/tools/dnsupdate/default.nix
@@ -0,0 +1,19 @@
+{ pkgs, ... }:
+
+pkgs.buildGoModule rec {
+  name = "dnsupdate";
+  src = ./.;
+  vendorSha256 = "sha256-DQ/kYC/EZpcOKk0Y+DvwJtAPZpamxvEl7gKk8uEB2Ls=";
+  nativeBuildInputs = with pkgs; [ go ];
+
+  push = pkgs.writers.writeBashBin "dns-push" ''
+    set -ueo pipefail
+
+    cd $(git rev-parse --show-toplevel)/tools/dnsupdate
+
+    export TS_API_KEY=$(pass api/api.tailscale.com)
+    export GOOGLE_APPLICATION_CREDENTIALS=/run/agenix/gcloud/world-nix
+
+    go run .
+  '';
+}