mirror of
https://github.com/packwiz/packwiz.git
synced 2025-08-20 23:16:31 +02:00
Since nix tries to update inputs on newer versions out of, I suppose, some introduced incompatibility, `nix build` fails. And nixpkgs from 2023 sounds rather obsolete at this point, so update was kinda due I think. On newer versions of nixpkgs however buildGoModule has changed and requires one of its arguments to be called vendorHash and not vendorSha256, this patch changes that as well. Fixes #297, closes #314, closes #307
39 lines
1.0 KiB
Nix
39 lines
1.0 KiB
Nix
let
|
|
# Import nixpkgs if needed
|
|
pkgs = import <nixpkgs> {};
|
|
in
|
|
{
|
|
lib ? pkgs.lib,
|
|
buildGoModule ? pkgs.buildGoModule,
|
|
fetchFromGitHub ? pkgs.fetchFromGitHub,
|
|
installShellFiles ? pkgs.installShellFiles,
|
|
# version and vendorHash should be specified by the caller
|
|
version ? "latest",
|
|
vendorHash,
|
|
}:
|
|
buildGoModule rec {
|
|
pname = "packwiz";
|
|
inherit version vendorHash;
|
|
|
|
src = ./..;
|
|
|
|
nativeBuildInputs = [
|
|
installShellFiles
|
|
];
|
|
|
|
# Install shell completions
|
|
postInstall = ''
|
|
installShellCompletion --cmd packwiz \
|
|
--bash <($out/bin/packwiz completion bash) \
|
|
--fish <($out/bin/packwiz completion fish) \
|
|
--zsh <($out/bin/packwiz completion zsh)
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "A command line tool for editing and distributing Minecraft modpacks, using a git-friendly TOML format";
|
|
homepage = "https://packwiz.infra.link/";
|
|
license = licenses.mit;
|
|
mainProgram = "packwiz";
|
|
};
|
|
}
|