Files
nixpkgs/pkgs/by-name/ru/runme/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

82 lines
1.9 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
nodejs,
python3,
runtimeShell,
stdenv,
testers,
runme,
}:
buildGoModule rec {
pname = "runme";
version = "3.15.2";
src = fetchFromGitHub {
owner = "runmedev";
repo = "runme";
rev = "v${version}";
hash = "sha256-NtFKzObi0mIdzhRiu7CCZ3e4yIhI2gHMtVsdf5TEb/s=";
};
vendorHash = "sha256-Uw5igaQpKKI4y7EoznFdmyTXfex350Pps6nt3lvKeAM=";
nativeBuildInputs = [
installShellFiles
];
nativeCheckInputs = [
nodejs
python3
];
subPackages = [
"."
];
ldflags = [
"-s"
"-w"
"-X=github.com/runmedev/runme/v3/internal/version.BuildDate=1970-01-01T00:00:00Z"
"-X=github.com/runmedev/runme/v3/internal/version.BuildVersion=${version}"
"-X=github.com/runmedev/runme/v3/internal/version.Commit=${src.rev}"
];
# checkFlags = [
# "-ldflags=-X=github.com/runmedev/runme/v3/internal/version.BuildVersion=${version}"
# ];
# tests fail to access /etc/bashrc on darwin
doCheck = !stdenv.hostPlatform.isDarwin;
postPatch = ''
substituteInPlace testdata/{flags/fmt,prompts/basic,runall/basic,script/basic,tags/categories}.txtar \
--replace-fail /bin/bash "${runtimeShell}"
'';
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 = {
description = "Execute commands inside your runbooks, docs, and READMEs";
mainProgram = "runme";
homepage = "https://runme.dev";
changelog = "https://github.com/runmedev/runme/releases/tag/v${version}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ figsoda ];
};
}