Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

71 lines
2.0 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
}:
let
config-module = "github.com/f1bonacc1/process-compose/src/config";
in
buildGoModule (finalAttrs: {
pname = "process-compose";
version = "1.75.2";
src = fetchFromGitHub {
owner = "F1bonacc1";
repo = "process-compose";
tag = "v${finalAttrs.version}";
hash = "sha256-BKf8FrgpGhYzuukAFP+OCjvp5bMCQL6BmZ+Tk/E8RIY=";
# 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
'';
};
# 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)"
'';
ldflags = [
"-X ${config-module}.Version=v${finalAttrs.version}"
"-s"
"-w"
];
nativeBuildInputs = [
installShellFiles
];
vendorHash = "sha256-AXmULIWtEsNhSZ764BH5AkXlh49HNKT1jZABzhPIzPQ=";
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 = {
description = "Simple and flexible scheduler and orchestrator to manage non-containerized applications";
homepage = "https://github.com/F1bonacc1/process-compose";
changelog = "https://github.com/F1bonacc1/process-compose/releases/tag/v${finalAttrs.version}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ thenonameguy ];
mainProgram = "process-compose";
};
})