2023-02-02 18:25:31 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, makeWrapper
|
|
|
|
, installShellFiles
|
|
|
|
, docker
|
|
|
|
, distrobox
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "apx";
|
2023-02-22 10:55:15 +00:00
|
|
|
version = "1.7.0-1";
|
2023-02-02 18:25:31 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Vanilla-OS";
|
|
|
|
repo = pname;
|
2023-02-22 10:55:15 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-tonI3S0a08MbR369qaKS2BoWc3QzXWzTuGx/zSgUz7s=";
|
2023-02-02 18:25:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
vendorSha256 = null;
|
|
|
|
|
|
|
|
ldflags = [ "-s" "-w" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
installShellFiles
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/etc/apx
|
|
|
|
|
|
|
|
cat > "$out/etc/apx/config.json" <<EOF
|
|
|
|
{
|
|
|
|
"containername": "apx_managed",
|
|
|
|
"image": "docker.io/library/ubuntu",
|
|
|
|
"pkgmanager": "apt",
|
|
|
|
"distroboxpath": "${distrobox}/bin/distrobox"
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
wrapProgram $out/bin/apx --prefix PATH : ${lib.makeBinPath [ docker distrobox ]}
|
|
|
|
|
|
|
|
installManPage man/apx.1 man/es/apx.1
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "The Vanilla OS package manager";
|
|
|
|
homepage = "https://github.com/Vanilla-OS/apx";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ dit7ya ];
|
|
|
|
};
|
|
|
|
}
|