Files
nixpkgs/pkgs/by-name/gh/gh-classroom/package.nix
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

53 lines
1.3 KiB
Nix

{
lib,
stdenv,
buildPackages,
fetchFromGitHub,
buildGoModule,
nix-update-script,
installShellFiles,
}:
buildGoModule (finalAttrs: {
pname = "gh-classroom";
version = "0.1.15";
src = fetchFromGitHub {
owner = "github";
repo = "gh-classroom";
tag = "v${finalAttrs.version}";
hash = "sha256-s7S7rk5I0mdXZh4pz1aF0btntuse3mpSZe/JiS/KlkU=";
};
vendorHash = "sha256-7P1TTv6EW351EbLT+oruztE5Zs9I01uRnel+OGUdV6M=";
ldflags = [
"-s"
"-w"
"-X main.Version=${finalAttrs.version}"
];
nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) (
let
emulator = stdenv.hostPlatform.emulator buildPackages;
in
''
installShellCompletion --cmd gh-classroom \
--bash <(${emulator} $out/bin/gh-classroom --bash-completion) \
--fish <(${emulator} $out/bin/gh-classroom --fish-completion) \
--zsh <(${emulator} $out/bin/gh-classroom --zsh-completion)
''
);
passthru.updateScript = nix-update-script { };
meta = {
homepage = "https://github.com/github/gh-classroom";
description = "Extension for the GitHub CLI, that enhances it for educators using GitHub classroom";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ _0x5a4 ];
mainProgram = "gh-classroom";
};
})