From b4fcf4bef44e6f3ccd4fcc5363f61f4f22ae23fe Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sat, 7 May 2022 16:00:40 -0700 Subject: nix: add a command `dnsupdate` to update the DNS Running `nix run .#dnsupdate` will execute the program to ensure the configuration is correct. --- flake.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index ae89d70..fb00e4a 100644 --- a/flake.nix +++ b/flake.nix @@ -52,7 +52,17 @@ pkgs = import inputs.nixpkgs { inherit system; }; home-manager = inputs.home-manager.defaultPackage."${system}"; in { - packages = pkgs // { inherit home-manager; }; + packages = pkgs // { + inherit home-manager; + + # nix run .#dnsupdate + dnsupdate = pkgs.writers.writeBashBin "dnsupdate" '' + #!/usr/bin/env bash + export TS_API_KEY=$(pass api/api.tailscale.com) + export GOOGLE_APPLICATION_CREDENTIALS=/run/agenix/gcloud/world-nix + go run ./cmd/dnsupdate/ + ''; + }; checks = { pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run { @@ -70,6 +80,8 @@ rnix-lsp home-manager git + go + gopls ]; }; }); -- cgit 1.4.1