1{ lib
2, stdenv
3, nix-update-script
4, fetchFromGitHub
5, rustPlatform
6, pkg-config
7, installShellFiles
8, zstd
9, openssl
10, Security
11}:
12
13rustPlatform.buildRustPackage rec {
14 pname = "owmods-cli";
15 version = "0.11.3";
16
17 src = fetchFromGitHub {
18 owner = "ow-mods";
19 repo = "ow-mod-man";
20 rev = "cli_v${version}";
21 hash = "sha256-CobGF3ZQEdRRoMGL9l37alGQArIuRxiFbihQoRdnAsc=";
22 };
23
24 cargoLock = {
25 lockFile = ./Cargo.lock;
26 outputHashes = {
27 "tauri-plugin-window-state-0.1.0" = "sha256-M6uGcf4UWAU+494wAK/r2ta1c3IZ07iaURLwJJR9F3U=";
28 };
29 };
30
31 nativeBuildInputs = [
32 pkg-config
33 installShellFiles
34 ];
35
36 buildInputs = [
37 zstd
38 ] ++ lib.optionals stdenv.isLinux [
39 openssl
40 ] ++ lib.optionals stdenv.isDarwin [
41 Security
42 ];
43
44 env = {
45 ZSTD_SYS_USE_PKG_CONFIG = true;
46 };
47
48 buildAndTestSubdir = "owmods_cli";
49
50 postInstall = ''
51 cargo xtask dist_cli
52 installManPage man/man*/*
53 installShellCompletion --cmd owmods \
54 dist/cli/completions/owmods.{bash,fish,zsh}
55 '';
56
57 passthru.updateScript = nix-update-script {};
58
59 meta = with lib; {
60 description = "CLI version of the mod manager for Outer Wilds Mod Loader";
61 homepage = "https://github.com/ow-mods/ow-mod-man/tree/main/owmods_cli";
62 downloadPage = "https://github.com/ow-mods/ow-mod-man/releases/tag/cli_v${version}";
63 changelog = "https://github.com/ow-mods/ow-mod-man/releases/tag/cli_v${version}";
64 mainProgram = "owmods";
65 license = licenses.gpl3Plus;
66 maintainers = with maintainers; [ locochoco ];
67 };
68}