From a4c74ea0decb9c6e04b9abb5124b81438940d07f Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Wed, 25 May 2022 19:39:32 -0700 Subject: ref(dnsupdate): move under tools Integrate properly the tool `dnsupdate` with flake.nix, by adding a default.nix inside its directory. Having all the tools under a directory named `tools` is easier to reason about. I don't need a go.mod at the top level directory either, each tool will have its own. --- tools/dnsupdate/default.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tools/dnsupdate/default.nix (limited to 'tools/dnsupdate/default.nix') 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 . + ''; +} -- cgit 1.4.1