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-01-13 08:15:51 +00:00
|
|
|
version = "2.2.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-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-za3QS0ZJuxSCt5xbYa/Kt4ARsDhUn34vJTy0fJoqr9U=";
|
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-01-13 08:15:51 +00:00
|
|
|
install -m 444 -D config/apx.json -t $out/share/apx/
|
|
|
|
installManPage man/man1/*
|
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
|
|
|
};
|
|
|
|
}
|