14 src = fetchFromGitHub {
18 hash = "sha256-60z6wbbXQp7MA5l7LP/mToZftX+nbcs2Mewg5jCFwFk=";
21 vendorHash = "sha256-YHnPLjZWUYoARHF4V1Pm1LYdCJGubPCve0wQ5FpeXUg=";
23 # podman needed for apx to not error when building shell completions
24 nativeBuildInputs = [ installShellFiles podman ];
26 ldflags = [ "-s" "-w" "-X 'main.Version=v${version}'" ];
29 substituteInPlace config/apx.json \
30 --replace-fail "/usr/share/apx/distrobox/distrobox" "${distrobox}/bin/distrobox" \
31 --replace-fail "/usr/share/apx" "$out/bin/apx"
32 substituteInPlace settings/config.go \
33 --replace-fail "/usr/share/apx/" "$out/share/apx/"
37 install -Dm444 config/apx.json -t $out/share/apx/
38 installManPage man/man1/*
39 install -Dm444 README.md -t $out/share/docs/apx
40 install -Dm444 COPYING.md $out/share/licenses/apx/LICENSE
42 # Create a temp writable home-dir so apx outputs completions without error
43 export HOME=$(mktemp -d)
44 # apx command now works (for completions)
45 # though complains "Error: no such file or directory"
46 installShellCompletion --cmd apx \
47 --bash <($out/bin/apx completion bash) \
48 --fish <($out/bin/apx completion fish) \
49 --zsh <($out/bin/apx completion zsh)
53 description = "Vanilla OS package manager";
54 homepage = "https://github.com/Vanilla-OS/apx";
55 changelog = "https://github.com/Vanilla-OS/apx/releases/tag/v${version}";
56 license = licenses.gpl3Only;
57 maintainers = with maintainers; [ dit7ya chewblacka ];