nixpkgs/pkgs/by-name/ja/jan/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
1.1 KiB
Nix
Raw Normal View History

2024-02-07 14:01:24 +00:00
{ lib
, appimageTools
, fetchurl
}:
let
pname = "jan";
2024-04-25 13:09:53 +00:00
version = "0.4.12";
2024-02-07 14:01:24 +00:00
src = fetchurl {
url = "https://github.com/janhq/jan/releases/download/v${version}/jan-linux-x86_64-${version}.AppImage";
2024-04-25 13:09:53 +00:00
hash = "sha256-IMqTQGuMuivUq8UTpgNRSHwskxvA/2XWA1bp38MDJdI=";
2024-02-07 14:01:24 +00:00
};
appimageContents = appimageTools.extractType2 { inherit pname version src; };
in
appimageTools.wrapType2 {
inherit pname version src;
extraInstallCommands = ''
install -Dm444 ${appimageContents}/jan.desktop -t $out/share/applications
substituteInPlace $out/share/applications/jan.desktop \
2024-04-19 09:21:56 +00:00
--replace-fail 'Exec=AppRun --no-sandbox %U' 'Exec=jan'
2024-02-07 14:01:24 +00:00
cp -r ${appimageContents}/usr/share/icons $out/share
'';
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";
homepage = "https://github.com/janhq/jan";
license = lib.licenses.agpl3Plus;
mainProgram = "jan";
maintainers = with lib.maintainers; [ drupol ];
platforms = lib.platforms.linux;
};
}