runme: init at 1.2.1

https://github.com/stateful/runme
https://runme.dev
This commit is contained in:
figsoda 2023-05-24 20:14:38 -04:00
parent 105037c7cf
commit 2abb67c0ec
2 changed files with 72 additions and 0 deletions

View file

@ -0,0 +1,70 @@
{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
, runtimeShell
, stdenv
, testers
, runme
}:
buildGoModule rec {
pname = "runme";
version = "1.2.1";
src = fetchFromGitHub {
owner = "stateful";
repo = "runme";
rev = "v${version}";
hash = "sha256-Gk15sqGQRL5v7Fo+tIYM4GM1FihoEAs23HK0cQN9hy4=";
};
vendorHash = "sha256-el+gM3GRN5KU4RlSAx02rn+22xj28IZq3erZUzPbUUw=";
nativeBuildInputs = [
installShellFiles
];
subPackages = [
"."
];
ldflags = [
"-s"
"-w"
"-X=github.com/stateful/runme/internal/version.BuildDate=1970-01-01T00:00:00Z"
"-X=github.com/stateful/runme/internal/version.BuildVersion=${version}"
"-X=github.com/stateful/runme/internal/version.Commit=${src.rev}"
];
postPatch = ''
substituteInPlace testdata/script/basic.txtar \
--replace /bin/bash "${runtimeShell}"
'';
# version test assumes `ldflags` is unspecified
preCheck = ''
unset ldflags
'';
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd runme \
--bash <($out/bin/runme completion bash) \
--fish <($out/bin/runme completion fish) \
--zsh <($out/bin/runme completion zsh)
'';
passthru.tests = {
version = testers.testVersion {
package = runme;
};
};
meta = with lib; {
description = "Execute commands inside your runbooks, docs, and READMEs";
homepage = "https://runme.dev";
changelog = "https://github.com/stateful/runme/releases/tag/v${src.rev}";
license = licenses.asl20;
maintainers = with maintainers; [ figsoda ];
};
}

View file

@ -12038,6 +12038,8 @@ with pkgs;
rund = callPackage ../development/tools/rund { };
runme = callPackage ../development/tools/misc/runme { };
runzip = callPackage ../tools/archivers/runzip { };
unzoo = callPackage ../tools/archivers/unzoo { };