at 24.05-pre 77 lines 1.7 kB view raw
1{ lib 2, buildGo121Module 3, fetchFromGitHub 4, installShellFiles 5, nodejs 6, python3 7, runtimeShell 8, stdenv 9, testers 10, runme 11}: 12 13buildGo121Module rec { 14 pname = "runme"; 15 version = "1.7.8"; 16 17 src = fetchFromGitHub { 18 owner = "stateful"; 19 repo = "runme"; 20 rev = "v${version}"; 21 hash = "sha256-ZM8gdZ26XAlC+j6U0+oQJIb+5gOGFUAYHPP82kA1ogU="; 22 }; 23 24 vendorHash = "sha256-nKH4hT0J9QfrDdvovu/XNxU4PtZYKkfqEBiCTNLWyRA="; 25 26 nativeBuildInputs = [ 27 installShellFiles 28 ]; 29 30 nativeCheckInputs = [ 31 nodejs 32 python3 33 ]; 34 35 subPackages = [ 36 "." 37 ]; 38 39 ldflags = [ 40 "-s" 41 "-w" 42 "-X=github.com/stateful/runme/internal/version.BuildDate=1970-01-01T00:00:00Z" 43 "-X=github.com/stateful/runme/internal/version.BuildVersion=${version}" 44 "-X=github.com/stateful/runme/internal/version.Commit=${src.rev}" 45 ]; 46 47 postPatch = '' 48 substituteInPlace testdata/script/basic.txtar \ 49 --replace /bin/bash "${runtimeShell}" 50 ''; 51 52 # version test assumes `ldflags` is unspecified 53 preCheck = '' 54 unset ldflags 55 ''; 56 57 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' 58 installShellCompletion --cmd runme \ 59 --bash <($out/bin/runme completion bash) \ 60 --fish <($out/bin/runme completion fish) \ 61 --zsh <($out/bin/runme completion zsh) 62 ''; 63 64 passthru.tests = { 65 version = testers.testVersion { 66 package = runme; 67 }; 68 }; 69 70 meta = with lib; { 71 description = "Execute commands inside your runbooks, docs, and READMEs"; 72 homepage = "https://runme.dev"; 73 changelog = "https://github.com/stateful/runme/releases/tag/v${version}"; 74 license = licenses.asl20; 75 maintainers = with maintainers; [ figsoda ]; 76 }; 77}