aboutsummaryrefslogtreecommitdiff
path: root/modules/pkgs/check_aws_s3_file/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/pkgs/check_aws_s3_file/default.nix')
-rw-r--r--modules/pkgs/check_aws_s3_file/default.nix22
1 files changed, 22 insertions, 0 deletions
diff --git a/modules/pkgs/check_aws_s3_file/default.nix b/modules/pkgs/check_aws_s3_file/default.nix
new file mode 100644
index 0000000..df84c79
--- /dev/null
+++ b/modules/pkgs/check_aws_s3_file/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, pkgs, makeWrapper }:
+
+stdenv.mkDerivation {
+ name = "check_aws_s3_file";
+ outputs = [ "out" "conf" ];
+ unpackPhase = ":";
+ nativeBuildInputs = [ makeWrapper ];
+ installPhase = ''
+ mkdir -p $out/bin
+
+ cp ${./check_aws_s3_file} $out/bin/check_aws_s3_file
+ cp ${./check_aws_s3_file.conf} $conf
+
+ chmod +x "$out/bin/"*
+
+ substituteInPlace "$conf" \
+ --replace check_aws_s3_file "$out/bin/check_aws_s3_file"
+
+ wrapProgram "$out/bin/check_aws_s3_file" \
+ --prefix PATH : "${pkgs.awscli}/bin:${pkgs.gnugrep}/bin:${pkgs.jq}/bin"
+ '';
+}