From 1bc7f5b92df608b76acb0cc87ddceba74dc0ae9f Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Wed, 15 Jan 2025 19:35:50 +0000 Subject: [PATCH] feat: use local packwiz package --- .packwizignore | 3 ++- flake.nix | 3 ++- nix/packwiz.nix | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 nix/packwiz.nix diff --git a/.packwizignore b/.packwizignore index 5e0e775..746c876 100644 --- a/.packwizignore +++ b/.packwizignore @@ -1,7 +1,8 @@ # DOnt add teh IDE's /.idea -# dont add flake stuff +# dont add nix stuff flake.* +/nix *.md diff --git a/flake.nix b/flake.nix index 4563fd8..868b796 100644 --- a/flake.nix +++ b/flake.nix @@ -7,6 +7,7 @@ }; nixConfig = { + bash-prompt-suffix = "[Skynet Dev] "; extra-substituters = "https://nix-cache.skynet.ie/skynet-cache"; extra-trusted-public-keys = "skynet-cache:zMFLzcRZPhUpjXUy8SF8Cf7KGAZwo98SKrzeXvdWABo="; }; @@ -20,7 +21,7 @@ system: let pkgs = (import nixpkgs) {inherit system;}; packages = with pkgs; [ - packwiz + (pkgs.callPackage ./nix/packwiz.nix {}) ]; in rec { diff --git a/nix/packwiz.nix b/nix/packwiz.nix new file mode 100644 index 0000000..331ffc7 --- /dev/null +++ b/nix/packwiz.nix @@ -0,0 +1,41 @@ +{ + lib, + buildGoModule, + fetchFromGitHub, + installShellFiles, + unstableGitUpdater, +}: + +buildGoModule { + pname = "packwiz"; + version = "0-unstable-2024-10-15"; + + src = fetchFromGitHub { + owner = "packwiz"; + repo = "packwiz"; + rev = "0626c00149a8d9a5e9f76e5640e7b8b95c064350"; + sha256 = "sha256-eAGfLUcyjDR2oJjLK3+DiuICTqoOcIwO5wL350w6vGw="; + }; + passthru.updateScript = unstableGitUpdater { }; + + vendorHash = "sha256-krdrLQHM///dtdlfEhvSUDV2QljvxFc2ouMVQVhN7A0="; + + nativeBuildInputs = [ + installShellFiles + ]; + + 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 = "Command line tool for editing and distributing Minecraft modpacks, using a git-friendly TOML format"; + homepage = "https://packwiz.infra.link/"; + license = licenses.mit; + maintainers = with maintainers; [ infinidoge ]; + mainProgram = "packwiz"; + }; +} \ No newline at end of file