mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-23 06:03:40 +00:00
30 lines
836 B
Nix
30 lines
836 B
Nix
{ lib
|
|
, appimageTools
|
|
, fetchurl
|
|
, version
|
|
, pname
|
|
, meta
|
|
}:
|
|
let
|
|
src = fetchurl {
|
|
url = "https://releases.lmstudio.ai/linux/${version}/beta/LM_Studio-${version}.AppImage";
|
|
hash = "sha256-hcV8wDhulFAxHDBDKicpEGovwcsn9RaIi/idUz+YzD8=";
|
|
};
|
|
|
|
appimageContents = appimageTools.extractType2 { inherit pname version src; };
|
|
in
|
|
appimageTools.wrapType2 {
|
|
inherit meta pname version src;
|
|
|
|
extraPkgs = pkgs: (appimageTools.defaultFhsEnvArgs.multiPkgs 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'
|
|
'';
|
|
}
|
|
|