2023-02-02 18:25:31 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, distrobox
|
2024-01-13 08:15:51 +00:00
|
|
|
, installShellFiles
|
2023-02-02 18:25:31 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "apx";
|
2024-02-07 01:22:34 +00:00
|
|
|
version = "2.4.0";
|
2023-02-02 18:25:31 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Vanilla-OS";
|
2024-01-13 08:15:51 +00:00
|
|
|
repo = "apx";
|
2023-11-16 04:20:00 +00:00
|
|
|
rev = "v${version}";
|
2024-02-07 01:22:34 +00:00
|
|
|
hash = "sha256-OLJrwibw9uX5ty7FRZ0q8zx0i1vQXRKK8reQsJFFxAI=";
|
2023-02-02 18:25:31 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
vendorHash = null;
|
2023-02-02 18:25:31 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
ldflags = [ "-s" "-w" ];
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace config/apx.json \
|
2024-01-02 11:29:13 +00:00
|
|
|
--replace "/usr/share/apx/distrobox/distrobox" "${distrobox}/bin/distrobox" \
|
2023-11-16 04:20:00 +00:00
|
|
|
--replace "/usr/share/apx" "$out/bin/apx"
|
|
|
|
substituteInPlace settings/config.go \
|
|
|
|
--replace "/usr/share/apx/" "$out/share/apx/"
|
|
|
|
'';
|
2023-02-02 18:25:31 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2024-02-07 01:22:34 +00:00
|
|
|
install -Dm444 config/apx.json -t $out/share/apx/
|
2024-01-13 08:15:51 +00:00
|
|
|
installManPage man/man1/*
|
2024-02-07 01:22:34 +00:00
|
|
|
install -Dm444 README.md -t $out/share/docs/apx
|
|
|
|
install -Dm444 COPYING.md $out/share/licenses/apx/LICENSE
|
2023-02-02 18:25:31 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "The Vanilla OS package manager";
|
|
|
|
homepage = "https://github.com/Vanilla-OS/apx";
|
2023-11-16 04:20:00 +00:00
|
|
|
changelog = "https://github.com/Vanilla-OS/apx/releases/tag/v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
license = licenses.gpl3Only;
|
2024-01-02 11:29:13 +00:00
|
|
|
maintainers = with maintainers; [ dit7ya chewblacka ];
|
|
|
|
mainProgram = "apx";
|
2023-02-02 18:25:31 +00:00
|
|
|
};
|
|
|
|
}
|