apx: add update script (#467851)
This commit is contained in:
@@ -6,6 +6,10 @@
|
||||
distrobox,
|
||||
podman,
|
||||
writableTmpDirAsHomeHook,
|
||||
curl,
|
||||
jq,
|
||||
common-updater-scripts,
|
||||
writeShellScript,
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
@@ -76,6 +80,26 @@ buildGoModule rec {
|
||||
--zsh <($out/bin/apx completion zsh)
|
||||
'';
|
||||
|
||||
passthru.updateScript = writeShellScript "update-apx" ''
|
||||
set -euo pipefail
|
||||
PATH=${
|
||||
lib.makeBinPath [
|
||||
curl
|
||||
jq
|
||||
common-updater-scripts
|
||||
]
|
||||
}:$PATH
|
||||
|
||||
echo "Fetching latest version for vanilla-apx-configs..."
|
||||
LATEST_CONFIG=$(curl -s https://api.github.com/repos/Vanilla-OS/vanilla-apx-configs/releases/latest | jq -r .tag_name | sed 's/^v//')
|
||||
|
||||
echo "Updating versionConfig to $LATEST_CONFIG..."
|
||||
update-source-version apx "$LATEST_CONFIG" --version-key=versionConfig --source-key=configsSrc
|
||||
|
||||
echo "Updating main apx package..."
|
||||
nix-update apx
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Vanilla OS package manager";
|
||||
longDescription = ''
|
||||
@@ -94,6 +118,7 @@ buildGoModule rec {
|
||||
maintainers = with lib.maintainers; [
|
||||
dit7ya
|
||||
chewblacka
|
||||
masrlinu
|
||||
];
|
||||
mainProgram = "apx";
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user