2022-11-21 17:40:18 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
}:
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
let config-module = "github.com/f1bonacc1/process-compose/src/config";
|
|
|
|
in
|
2022-11-21 17:40:18 +00:00
|
|
|
buildGoModule rec {
|
|
|
|
pname = "process-compose";
|
2024-10-04 16:56:33 +00:00
|
|
|
version = "1.34.0";
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "F1bonacc1";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-10-04 16:56:33 +00:00
|
|
|
hash = "sha256-Ymd3X6qvdYENbjb2F0ajjb1j0tuy835W6YWCeuvLoXc=";
|
2023-01-11 07:51:40 +00:00
|
|
|
# populate values that require us to use git. By doing this in postFetch we
|
|
|
|
# can delete .git afterwards and maintain better reproducibility of the src.
|
|
|
|
leaveDotGit = true;
|
|
|
|
postFetch = ''
|
|
|
|
cd "$out"
|
|
|
|
git rev-parse --short HEAD > $out/COMMIT
|
|
|
|
# in format of 0000-00-00T00:00:00Z
|
|
|
|
date -u -d "@$(git log -1 --pretty=%ct)" "+%Y-%m-%dT%H:%M:%SZ" > $out/SOURCE_DATE_EPOCH
|
|
|
|
find "$out" -name .git -print0 | xargs -0 rm -rf
|
|
|
|
'';
|
2022-11-21 17:40:18 +00:00
|
|
|
};
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
# ldflags based on metadata from git and source
|
|
|
|
preBuild = ''
|
|
|
|
ldflags+=" -X ${config-module}.Commit=$(cat COMMIT)"
|
|
|
|
ldflags+=" -X ${config-module}.Date=$(cat SOURCE_DATE_EPOCH)"
|
|
|
|
'';
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
ldflags = [
|
2023-01-11 07:51:40 +00:00
|
|
|
"-X ${config-module}.Version=v${version}"
|
2022-12-17 10:02:37 +00:00
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
];
|
2022-11-21 17:40:18 +00:00
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
];
|
2022-11-21 17:40:18 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
vendorHash = "sha256-G4ar+9ARBwR77t/6NswUDXpUw38rYnLy9lIep302mNI=";
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mv $out/bin/{src,process-compose}
|
|
|
|
|
|
|
|
installShellCompletion --cmd process-compose \
|
|
|
|
--bash <($out/bin/process-compose completion bash) \
|
|
|
|
--zsh <($out/bin/process-compose completion zsh) \
|
|
|
|
--fish <($out/bin/process-compose completion fish)
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Simple and flexible scheduler and orchestrator to manage non-containerized applications";
|
2022-11-21 17:40:18 +00:00
|
|
|
homepage = "https://github.com/F1bonacc1/process-compose";
|
2022-12-17 10:02:37 +00:00
|
|
|
changelog = "https://github.com/F1bonacc1/process-compose/releases/tag/v${version}";
|
2022-11-21 17:40:18 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ thenonameguy ];
|
2024-02-29 20:09:43 +00:00
|
|
|
mainProgram = "process-compose";
|
2022-11-21 17:40:18 +00:00
|
|
|
};
|
|
|
|
}
|