jan: 0.8.2 -> 0.8.3 (#536752)
This commit is contained in:
@@ -12,16 +12,16 @@
|
||||
|
||||
let
|
||||
pname = "Jan";
|
||||
version = "0.8.2";
|
||||
version = "0.8.3";
|
||||
|
||||
darwin-src = fetchzip {
|
||||
url = "https://github.com/janhq/jan/releases/download/v${version}/jan-mac-universal-${version}.zip";
|
||||
hash = "sha256-DUyPMsy9POcxY5OyQu1IBAijTbUZACQB87j0CQDrw8A=";
|
||||
hash = "sha256-h2v71DzXez/+wlEp8IMVBk33LlXPhNPJ1UPNLYPShoE=";
|
||||
};
|
||||
|
||||
linux-src = fetchurl {
|
||||
url = "https://github.com/janhq/jan/releases/download/v${version}/jan_${version}_amd64.AppImage";
|
||||
hash = "sha256-OWg8P4g2g+LVJU+SnjajG2cqWnzl5X2fjqTGkIC3kAY=";
|
||||
url = "https://github.com/janhq/jan/releases/download/v${version}/Jan_${version}_amd64.AppImage";
|
||||
hash = "sha256-vEmioWQ4ic/FrtNFMKaLOcEy2BTRdouPc4PYWk90ZBI=";
|
||||
};
|
||||
|
||||
appimageContents = appimageTools.extractType2 {
|
||||
@@ -29,11 +29,14 @@ let
|
||||
src = linux-src;
|
||||
};
|
||||
|
||||
passthru.updateScript = ./update.sh;
|
||||
|
||||
meta = {
|
||||
changelog = "https://github.com/janhq/jan/releases/tag/v${version}";
|
||||
description = "Jan is an open source alternative to ChatGPT that runs 100% offline on your computer";
|
||||
description = "Open source alternative to ChatGPT that runs 100% offline on your computer";
|
||||
homepage = "https://github.com/janhq/jan";
|
||||
license = lib.licenses.asl20;
|
||||
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
||||
mainProgram = "Jan";
|
||||
maintainers = with lib.maintainers; [ dfjay ];
|
||||
platforms =
|
||||
@@ -56,25 +59,20 @@ let
|
||||
cudaPackages.cudatoolkit
|
||||
];
|
||||
|
||||
inherit meta;
|
||||
inherit passthru meta;
|
||||
};
|
||||
|
||||
darwin = stdenv.mkDerivation {
|
||||
inherit
|
||||
pname
|
||||
version
|
||||
meta
|
||||
;
|
||||
inherit pname version;
|
||||
|
||||
src = darwin-src;
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
sourceRoot = "${pname}.app";
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
@@ -87,6 +85,8 @@ let
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
inherit passthru meta;
|
||||
};
|
||||
in
|
||||
if stdenv.hostPlatform.isDarwin then darwin else linux
|
||||
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p bash nixVersions.latest curl coreutils jq common-updater-scripts
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
latestTag=$(curl ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} -sL https://api.github.com/repos/janhq/jan/releases/latest | jq -r ".tag_name")
|
||||
latestVersion="${latestTag#v}"
|
||||
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; jan.version" | tr -d '"')
|
||||
|
||||
echo "latest version: $latestVersion"
|
||||
echo "current version: $currentVersion"
|
||||
|
||||
if [[ "$latestVersion" == "$currentVersion" ]]; then
|
||||
echo "package is up-to-date"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
linuxUrl="https://github.com/janhq/jan/releases/download/v$latestVersion/Jan_${latestVersion}_amd64.AppImage"
|
||||
linuxHash=$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri "$(nix-prefetch-url "$linuxUrl")")
|
||||
update-source-version jan "$latestVersion" "$linuxHash" --system=x86_64-linux --ignore-same-version
|
||||
|
||||
darwinUrl="https://github.com/janhq/jan/releases/download/v$latestVersion/jan-mac-universal-${latestVersion}.zip"
|
||||
darwinHash=$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri "$(nix-prefetch-url --unpack "$darwinUrl")")
|
||||
update-source-version jan "$latestVersion" "$darwinHash" --system=aarch64-darwin --ignore-same-version
|
||||
Reference in New Issue
Block a user