-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: replace local otel-collector-builder with nixpkgs package
- Loading branch information
1 parent
29f154b
commit 036ba8c
Showing
12 changed files
with
126 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 27 additions & 21 deletions
48
src/build-support/mk-otel-collector-builder-configuration.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,36 @@ | ||
{ lib | ||
, writeTextFile | ||
, runCommand | ||
, go | ||
, remarshal | ||
{ | ||
lib, | ||
writeTextFile, | ||
runCommand, | ||
go, | ||
remarshal, | ||
}: | ||
|
||
{ name ? "${args'.pname}-${args'.version}-builder-configuration" | ||
, config ? { } | ||
, goPackage ? go | ||
, ... | ||
{ | ||
name ? "${args'.pname}-${args'.version}-builder-configuration", | ||
config ? { }, | ||
goPackage ? go, | ||
... | ||
}@args': | ||
let | ||
jsonFile = writeTextFile { | ||
name = "${name}.json"; | ||
text = builtins.toJSON ({ | ||
dist = { | ||
name = args'.pname; | ||
go = "${goPackage}/bin/go"; | ||
output_path = "output"; | ||
}; | ||
} // args'.config); | ||
text = builtins.toJSON ( | ||
{ | ||
dist = { | ||
name = args'.pname; | ||
go = "${goPackage}/bin/go"; | ||
output_path = "output"; | ||
}; | ||
} | ||
// args'.config | ||
); | ||
}; | ||
in | ||
runCommand "${name}.yaml" | ||
{ | ||
nativeBuildInputs = [ remarshal ]; | ||
} '' | ||
${remarshal}/bin/remarshal ${jsonFile} --of yaml > $out | ||
'' | ||
{ | ||
nativeBuildInputs = [ remarshal ]; | ||
} | ||
'' | ||
${remarshal}/bin/remarshal ${jsonFile} --of yaml > $out | ||
'' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
inputs: | ||
|
||
final: | ||
prev: | ||
final: prev: | ||
|
||
let | ||
packages = import ./packages inputs final prev; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.