From 595ee93e32205eb35124324c72a71bcca1e59f78 Mon Sep 17 00:00:00 2001 From: "Mr. why" Date: Wed, 15 Jul 2026 14:15:54 +0800 Subject: [PATCH] atomgit-cli: init at 0.5.0 Assisted-by: OpenAI Codex (GPT-5) --- pkgs/by-name/at/atomgit-cli/package.nix | 67 +++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 pkgs/by-name/at/atomgit-cli/package.nix diff --git a/pkgs/by-name/at/atomgit-cli/package.nix b/pkgs/by-name/at/atomgit-cli/package.nix new file mode 100644 index 000000000000..c300db3104f9 --- /dev/null +++ b/pkgs/by-name/at/atomgit-cli/package.nix @@ -0,0 +1,67 @@ +{ + lib, + stdenv, + buildGoModule, + fetchgit, + gitMinimal, + makeWrapper, + versionCheckHook, + writableTmpDirAsHomeHook, + xdg-utils, +}: + +buildGoModule (finalAttrs: { + pname = "atomgit-cli"; + version = "0.5.0"; + + src = fetchgit { + url = "https://atomgit.com/hust-open-atom-club/atomgit-cli.git"; + rev = "11f1ff216053bf47c0a3baaed6698c9222f1ce77"; + hash = "sha256-ZvQ8S0f1jUfN48UE/U+JnTTrtoWYZfwhDPDBbKKLlC0="; + }; + + vendorHash = "sha256-7K17JaXFsjf163g5PXCb5ng2gYdotnZ2IDKk8KFjNj0="; + + subPackages = [ "cmd/ag" ]; + + preCheck = '' + # Test all packages, not only cmd/ag. + unset subPackages + ''; + + ldflags = [ + "-s" + "-w" + "-X atomgit.com/hust-open-atom-club/atomgit-cli/internal/version.Version=v${finalAttrs.version}" + "-X atomgit.com/hust-open-atom-club/atomgit-cli/internal/version.Commit=${finalAttrs.src.rev}" + "-X atomgit.com/hust-open-atom-club/atomgit-cli/internal/version.BuildDate=2026-07-13T07:53:45Z" + ]; + + nativeBuildInputs = [ makeWrapper ]; + + postFixup = '' + wrapProgram $out/bin/ag \ + --prefix PATH : ${ + lib.makeBinPath ( + [ gitMinimal ] ++ lib.optionals stdenv.hostPlatform.isLinux [ xdg-utils ] + ) + } + ''; + + nativeInstallCheckInputs = [ + versionCheckHook + writableTmpDirAsHomeHook + ]; + versionCheckProgramArg = "version"; + versionCheckKeepEnvironment = [ "HOME" ]; + doInstallCheck = true; + + meta = { + description = "Command-line interface for AtomGit"; + homepage = "https://atomgit.com/hust-open-atom-club/atomgit-cli"; + changelog = "https://atomgit.com/hust-open-atom-club/atomgit-cli/tags/v${finalAttrs.version}"; + license = lib.licenses.mulan-psl2; + mainProgram = "ag"; + maintainers = [ lib.maintainers.silicalet ]; + }; +})