depot/third_party/nixpkgs/pkgs/by-name/lm/lmstudio/linux.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

29 lines
788 B
Nix

{ lib
, appimageTools
, fetchurl
, version
, pname
, meta
}:
let
src = fetchurl {
url = "https://releases.lmstudio.ai/linux/x86/${version}/beta/LM_Studio-${version}.AppImage";
hash = "sha256-2a3ac+0m3C/YyPM0Waia+x2Q/lodfbyHNvlbB2AHT78=";
};
appimageContents = appimageTools.extractType2 { inherit pname version src; };
in
appimageTools.wrapType2 {
inherit meta pname version src;
extraPkgs = pkgs: [ pkgs.ocl-icd ];
extraInstallCommands = ''
mkdir -p $out/share/applications
cp -r ${appimageContents}/usr/share/icons $out/share
install -m 444 -D ${appimageContents}/lm-studio.desktop -t $out/share/applications
substituteInPlace $out/share/applications/lm-studio.desktop \
--replace-fail 'Exec=AppRun --no-sandbox %U' 'Exec=lmstudio'
'';
}