at master 57 lines 1.5 kB view raw
1{ 2 lib, 3 stdenv, 4 buildGoModule, 5 fetchFromGitHub, 6 installShellFiles, 7 nix-update-script, 8 versionCheckHook, 9 writableTmpDirAsHomeHook, 10}: 11 12buildGoModule rec { 13 pname = "bootdev-cli"; 14 version = "1.20.4"; 15 16 src = fetchFromGitHub { 17 owner = "bootdotdev"; 18 repo = "bootdev"; 19 tag = "v${version}"; 20 hash = "sha256-ayjHhnnP6YWKMItsAw+nnScf1/eEHN2f7cOIkskE3mM="; 21 }; 22 23 vendorHash = "sha256-jhRoPXgfntDauInD+F7koCaJlX4XDj+jQSe/uEEYIMM="; 24 25 ldflags = [ 26 "-s" 27 "-w" 28 ]; 29 30 nativeBuildInputs = [ 31 installShellFiles 32 writableTmpDirAsHomeHook 33 ]; 34 35 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' 36 installShellCompletion --cmd bootdev \ 37 --bash <($out/bin/bootdev completion bash) \ 38 --zsh <($out/bin/bootdev completion zsh) \ 39 --fish <($out/bin/bootdev completion fish) 40 ''; 41 42 nativeInstallCheckInputs = [ versionCheckHook ]; 43 versionCheckProgram = "${placeholder "out"}/bin/bootdev"; 44 versionCheckProgramArg = "--version"; 45 doInstallCheck = true; 46 47 passthru.updateScript = nix-update-script { }; 48 49 meta = { 50 description = "CLI used to complete coding challenges and lessons on Boot.dev"; 51 homepage = "https://github.com/bootdotdev/bootdev"; 52 changelog = "https://github.com/bootdotdev/bootdev/releases/tag/v${version}"; 53 license = lib.licenses.mit; 54 maintainers = with lib.maintainers; [ vinnymeller ]; 55 mainProgram = "bootdev"; 56 }; 57}