about summary refs log tree commit diff
path: root/tools/dnsupdate/default.nix
blob: 85f02851453533bd5ae8aceedc1ce1d3e756eb8a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{ pkgs, buildGoModule, ... }:

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 .
  '';
}