Files
nixpkgs/pkgs/by-name/op/optnix/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

67 lines
1.5 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
buildGoModule,
installShellFiles,
nix-update-script,
scdoc,
}:
buildGoModule (finalAttrs: {
pname = "optnix";
version = "0.3.0";
src = fetchFromGitHub {
owner = "water-sucks";
repo = "optnix";
tag = "v${finalAttrs.version}";
hash = "sha256-kPCRCnjuKZd6RE5pkQJMYWpexnMyhUy9jrBFSztkiLM=";
};
vendorHash = "sha256-g/H91PiHWSRRQOkaobw2wAYX/07DFxWTCTlKzf7BT1Y=";
nativeBuildInputs = [
installShellFiles
scdoc
];
env = {
CGO_ENABLED = 0;
VERSION = finalAttrs.version;
};
buildPhase = ''
runHook preBuild
make all man
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -Dm755 ./optnix -t $out/bin
install -Dm755 ./optnix.1 -t $out/share/man/man1
install -Dm755 ./optnix.toml.5 -t $out/share/man/man5
runHook postInstall
'';
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd optnix \
--bash <($out/bin/optnix --completion bash) \
--fish <($out/bin/optnix --completion fish) \
--zsh <($out/bin/optnix --completion zsh)
'';
passthru.updateScript = nix-update-script { };
meta = {
homepage = "https://github.com/water-sucks/optnix";
description = "Options searcher for Nix module systems";
changelog = "https://github.com/water-sucks/optnix/releases/tag/v${finalAttrs.version}";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ water-sucks ];
mainProgram = "optnix";
};
})