mirror of
https://github.com/packwiz/packwiz.git
synced 2025-10-14 06:54:32 +02:00
Nix support & automated update (#130)
* Add a nix flake * Update flake deps and nix package's version nightly * nix-flake: Update vendorSha256 on each push An extra commit will be pushed only if needed * Move flake.* into root directory Update flake.lock * nix-flake: Support more systems, commit hash as version * Don't automatically update flake.lock
This commit is contained in:
committed by
GitHub
parent
d5290ebd32
commit
b8d9727833
38
nix/default.nix
Normal file
38
nix/default.nix
Normal file
@@ -0,0 +1,38 @@
|
||||
let
|
||||
# Import nixpkgs if needed
|
||||
pkgs = import <nixpkgs> {};
|
||||
in
|
||||
{
|
||||
lib ? pkgs.lib,
|
||||
buildGoModule ? pkgs.buildGoModule,
|
||||
fetchFromGitHub ? pkgs.fetchFromGitHub,
|
||||
installShellFiles ? pkgs.installShellFiles,
|
||||
# version and vendorSha256 should be specified by the caller
|
||||
version ? "latest",
|
||||
vendorSha256,
|
||||
}:
|
||||
buildGoModule rec {
|
||||
pname = "packwiz";
|
||||
inherit version vendorSha256;
|
||||
|
||||
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";
|
||||
};
|
||||
}
|
11
nix/prefetcher.nix
Normal file
11
nix/prefetcher.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
sha256,
|
||||
pkgs ? import <nixpkgs> {},
|
||||
}:
|
||||
pkgs.callPackage (import ./.) {
|
||||
buildGoModule = pkgs.buildGo118Module;
|
||||
vendorSha256 = sha256;
|
||||
}
|
||||
// {
|
||||
outputHash = sha256;
|
||||
}
|
1
nix/vendor-sha256
Normal file
1
nix/vendor-sha256
Normal file
@@ -0,0 +1 @@
|
||||
sha256-M9u7N4IrL0B4pPRQwQG5TlMaGT++w3ZKHZ0RdxEHPKk=
|
Reference in New Issue
Block a user