packwiz/nix/default.nix
Nikita c936fe72c5
Update and fix nix flake (#341)
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
2025-08-10 21:04:46 +01:00

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";
};
}