Skip to content

Commit

Permalink
Fetch lambad-promtail deps
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorwhitney committed Nov 16, 2023
1 parent b33a215 commit cedd715
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
6 changes: 5 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@

test = {
type = "app";
program = with pkgs; "${loki.overrideAttrs(old: rec { doCheck = true; })}/bin/loki --version";
program = with pkgs; "${
(writeShellScriptBin "test.sh" ''
${loki.overrideAttrs(old: { doCheck = true; })}/bin/loki --version
'')
}/bin/test.sh";
};

loki = {
Expand Down
22 changes: 22 additions & 0 deletions nix/packages/loki.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
{ pkgs, version, imageTag }:
let
lambda-promtail-gomod = pkgs.buildGoModule {
inherit version;
pname = "lambda-promtail";

src = ./../../tools/lambda-promtail;
vendorSha256 = "11yNeQb4k5/w0+r+LJOmjXUQRaWvWSXqM+zMHtMVxY8=";

doCheck = false;

installPhase = ''
runHook preInstall
cp -r --reflink=auto vendor $out
runHook postInstall
'';
};
in
pkgs.stdenv.mkDerivation {
inherit version;

Expand Down Expand Up @@ -37,6 +54,9 @@ pkgs.stdenv.mkDerivation {
buildPhase = ''
export GOCACHE=$TMPDIR/go-cache
export GOMODCACHE=$TMPDIR/gomodcache
export GOPROXY=off
cp -r ${lambda-promtail-gomod} tools/lambda-promtail/vendor
make clean loki
'';

Expand All @@ -45,6 +65,8 @@ pkgs.stdenv.mkDerivation {
export GOCACHE=$TMPDIR/go-cache
export GOMODCACHE=$TMPDIR/gomodcache
export GOLANGCI_LINT_CACHE=$TMPDIR/go-cache
export GOPROXY=off
make lint test
'';

Expand Down

0 comments on commit cedd715

Please sign in to comment.