Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at netboot-syslinux-multiplatform 56 lines 1.3 kB view raw
1{ lib 2, buildGoModule 3, fetchFromGitHub 4, git 5, ghq 6}: 7 8buildGoModule rec { 9 pname = "gst"; 10 version = "5.0.5"; 11 12 src = fetchFromGitHub { 13 owner = "uetchy"; 14 repo = "gst"; 15 rev = "v${version}"; 16 sha256 = "07cixz5wlzzb4cwcrncg2mz502wlhd3awql5js1glw9f6qfwc5in"; 17 }; 18 19 vendorSha256 = "0k5xl55vzpl64gwsgaff92jismpx6y7l2ia0kx7gamd1vklf0qwh"; 20 21 doCheck = false; 22 23 nativeBuildInputs = [ 24 git 25 ghq 26 ]; 27 28 ldflags = [ 29 "-s" "-w" "-X=main.Version=${version}" 30 ]; 31 32 doInstallCheck = true; 33 installCheckPhase = '' 34 if [[ "$("$out/bin/${pname}" --version)" == "${pname} version ${version}" ]]; then 35 export HOME=$(mktemp -d) 36 git config --global user.name "Test User" 37 git config --global user.email "test@example.com" 38 git config --global init.defaultBranch "main" 39 git config --global ghq.user "user" 40 ghq create test > /dev/null 2>&1 41 touch $HOME/ghq/github.com/user/test/SmokeTest 42 $out/bin/${pname} list | grep SmokeTest > /dev/null 43 echo '${pname} smoke check passed' 44 else 45 echo '${pname} smoke check failed' 46 return 1 47 fi 48 ''; 49 50 meta = { 51 description = "Supercharge your ghq workflow"; 52 homepage = "https://github.com/uetchy/gst"; 53 maintainers = with lib.maintainers; [ _0x4A6F ]; 54 license = lib.licenses.asl20; 55 }; 56}