diff options
author | Vincent Ambo <mail@tazj.in> | 2019-11-15T23·46+0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-15T23·46+0000 |
commit | ae53bf30c3306eeb56731e6e7aefc2bab278c6e0 (patch) | |
tree | ed66073f8c7dc2f01814ae8cc786bdf32988f0bd /tools | |
parent | 9ba4bbb60954c3fafb5e5f0aa5f8ff478c09a600 (diff) | |
parent | ecd54d58b1863ccd84e6a85b161fb1ef066e5efd (diff) |
Merge pull request #9 from tazjin/feat/read-tree r/95
Configure automatic package layouts via repository structure
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/bin/__dispatch.sh | 6 | ||||
-rw-r--r-- | tools/blog_cli/default.nix | 6 | ||||
-rw-r--r-- | tools/kms_pass.nix (renamed from tools/kms_pass/default.nix) | 24 |
3 files changed, 19 insertions, 17 deletions
diff --git a/tools/bin/__dispatch.sh b/tools/bin/__dispatch.sh index 20848bd5118c..c22b0339fd9e 100755 --- a/tools/bin/__dispatch.sh +++ b/tools/bin/__dispatch.sh @@ -11,19 +11,19 @@ readonly TARGET_TOOL=$(basename $0) case "${TARGET_TOOL}" in terraform) - attr="terraform-gcp" + attr="third_party.terraform-gcp" ;; kontemplate) attr="kontemplate" ;; blog_cli) - attr="tazjin.blog_cli" + attr="tools.blog_cli" ;; stern) attr="stern" ;; pass) - attr="tazjin.kms_pass" + attr="tools.kms_pass" ;; *) echo "The tool '${TARGET_TOOL}' is currently not installed in this repository." diff --git a/tools/blog_cli/default.nix b/tools/blog_cli/default.nix index c755d273a2b0..717daec86b9f 100644 --- a/tools/blog_cli/default.nix +++ b/tools/blog_cli/default.nix @@ -1,8 +1,10 @@ -{ buildGoPackage }: +{ pkgs, ... }: -buildGoPackage { +pkgs.buildGoPackage { name = "blog_cli"; goPackagePath = "github.com/tazjin/personal/blog_cli"; src = ./.; goDeps = ./deps.nix; + + meta.enableCI = true; } diff --git a/tools/kms_pass/default.nix b/tools/kms_pass.nix index fbc17650a948..7005697daaf8 100644 --- a/tools/kms_pass/default.nix +++ b/tools/kms_pass.nix @@ -6,10 +6,10 @@ # # Only the 'show' and 'insert' commands are supported. -{ google-cloud-sdk, tree, writeShellScriptBin -, project, region, keyring, key }: +{ pkgs, kms, ... }: -writeShellScriptBin "pass" '' +let inherit (pkgs) google-cloud-sdk tree writeShellScriptBin; +in (writeShellScriptBin "pass" '' set -eo pipefail CMD="$1" @@ -34,20 +34,20 @@ writeShellScriptBin "pass" '' show) secret_check ${google-cloud-sdk}/bin/gcloud kms decrypt \ - --project ${project} \ - --location ${region} \ - --keyring ${keyring} \ - --key ${key} \ + --project ${kms.project} \ + --location ${kms.region} \ + --keyring ${kms.keyring} \ + --key ${kms.key} \ --ciphertext-file $SECRET_PATH \ --plaintext-file - ;; insert) secret_check ${google-cloud-sdk}/bin/gcloud kms encrypt \ - --project ${project} \ - --location ${region} \ - --keyring ${keyring} \ - --key ${key} \ + --project ${kms.project} \ + --location ${kms.region} \ + --keyring ${kms.keyring} \ + --key ${kms.key} \ --ciphertext-file $SECRET_PATH \ --plaintext-file - echo "Inserted secret '$SECRET'" @@ -57,4 +57,4 @@ writeShellScriptBin "pass" '' exit 1 ;; esac -'' +'') // { meta.enableCI = true; } |