2023-02-02 18:25:31 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, distrobox
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "apx";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "2.0.0";
|
2023-02-02 18:25:31 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Vanilla-OS";
|
|
|
|
repo = pname;
|
2023-11-16 04:20:00 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-3CelqEntpfld0n+Ewg7NCkowVjgCf5b6StfSkYbgV5k=";
|
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
|
|
|
|
|
|
|
ldflags = [ "-s" "-w" ];
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace config/apx.json \
|
|
|
|
--replace "/usr/share/apx/distrobox" "${distrobox}/bin/distrobox" \
|
|
|
|
--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 = ''
|
2023-11-16 04:20:00 +00:00
|
|
|
install -D config/apx.json -t $out/share/apx/
|
|
|
|
install -D man/man1/apx.1 -t $out/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;
|
2023-11-16 04:20:00 +00:00
|
|
|
maintainers = with maintainers; [ dit7ya jgarcia ];
|
2023-02-02 18:25:31 +00:00
|
|
|
};
|
|
|
|
}
|