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
52 lines
1.4 KiB
Nix
52 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
buildGoModule,
|
|
fetchFromGitHub,
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "gomi";
|
|
version = "1.6.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "b4b4r07";
|
|
repo = "gomi";
|
|
tag = "v${version}";
|
|
hash = "sha256-Sxf/x29uADkdILrWwdKZhTc1Y7zCJbpMNK6vV/SGF1Q=";
|
|
# 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 show --format='%h' HEAD --quiet > ldflags_revision
|
|
date --utc --date="@$(git show --format='%ct' HEAD --quiet)" +'%Y-%m-%dT%H:%M:%SZ' > ldflags_buildDate
|
|
find . -type d -name .git -print0 | xargs -0 rm -rf
|
|
'';
|
|
};
|
|
|
|
vendorHash = "sha256-Lt2SA3IHD8wDxv5bScU37hqStnfxVYQQZS6ajr7PhJM=";
|
|
|
|
subPackages = [ "." ];
|
|
|
|
# Add version information fetched from the repository to ldflags.
|
|
# https://github.com/babarot/gomi/blob/v1.6.1/.goreleaser.yaml#L20-L22
|
|
ldflags = [
|
|
"-X main.version=v${version}"
|
|
];
|
|
preBuild = ''
|
|
ldflags+=" -X main.revision=$(cat ldflags_revision)"
|
|
ldflags+=" -X main.buildDate=$(cat ldflags_buildDate)"
|
|
'';
|
|
|
|
meta = {
|
|
description = "Replacement for UNIX rm command";
|
|
homepage = "https://github.com/b4b4r07/gomi";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [
|
|
mimame
|
|
ozkutuk
|
|
];
|
|
mainProgram = "gomi";
|
|
};
|
|
}
|