init commit
This commit is contained in:
commit
8f7a75814d
21 changed files with 1073 additions and 0 deletions
50
packages/otf/default.nix
Normal file
50
packages/otf/default.nix
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
buildGoModule,
|
||||
git,
|
||||
}:
|
||||
buildGoModule rec {
|
||||
pname = "otf";
|
||||
version = "0.3.23";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "leg100";
|
||||
repo = "otf";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-lm/J0ZEdkF+aI+NvbYg75rCexqjDLz/w+Sp9PhhAsv4=";
|
||||
leaveDotGit = true;
|
||||
postFetch = ''
|
||||
cd "$out"
|
||||
git rev-parse HEAD > $out/COMMIT_HASH
|
||||
date -u -d "@$(git log -1 --pretty=%ct)" "+%s" > $out/BUILD_TIME
|
||||
find "$out" -name .git -print0 | xargs -0 rm -rf
|
||||
'';
|
||||
};
|
||||
nativeBuildInputs = [ git ];
|
||||
|
||||
vendorHash = "sha256-8FcdezTBWCIChytTbJal3TzTi/JfUbkW3Yu4djzDIgk=";
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
"-w"
|
||||
"-X github.com/leg100/otf/internal.Version=v${version}"
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
ldflags+=" -X github.com/leg100/otf/internal.Commit=$(cat COMMIT_HASH)"
|
||||
ldflags+=" -X github.com/leg100/otf/internal.Built=$(cat BUILD_TIME)"
|
||||
'';
|
||||
|
||||
subPackages = [
|
||||
"cmd/otf"
|
||||
"cmd/otf-agent"
|
||||
"cmd/otfd"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "An open source alternative to Terraform Enterprise.";
|
||||
license = licenses.mpl20;
|
||||
platforms = platforms.linux ++ platforms.darwin;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue