Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
49 lines
1.1 KiB
Nix
49 lines
1.1 KiB
Nix
{
|
|
appimageTools,
|
|
fetchurl,
|
|
version,
|
|
url,
|
|
hash,
|
|
pname,
|
|
meta,
|
|
stdenv,
|
|
lib,
|
|
passthru,
|
|
}:
|
|
let
|
|
src = fetchurl { inherit url hash; };
|
|
|
|
appimageContents = appimageTools.extractType2 { inherit pname version src; };
|
|
in
|
|
appimageTools.wrapType2 {
|
|
inherit
|
|
meta
|
|
pname
|
|
version
|
|
src
|
|
passthru
|
|
;
|
|
|
|
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
|
|
|
|
# Rename the main executable from lmstudio to lm-studio
|
|
mv $out/bin/lmstudio $out/bin/lm-studio
|
|
|
|
substituteInPlace $out/share/applications/lm-studio.desktop \
|
|
--replace-fail 'Exec=AppRun --no-sandbox %U' 'Exec=lm-studio'
|
|
|
|
# lms cli tool
|
|
install -m 755 ${appimageContents}/resources/app/.webpack/lms $out/bin/
|
|
|
|
patchelf --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" \
|
|
--set-rpath "${lib.getLib stdenv.cc.cc}/lib:${lib.getLib stdenv.cc.cc}/lib64:$out/lib:${
|
|
lib.makeLibraryPath [ (lib.getLib stdenv.cc.cc) ]
|
|
}" $out/bin/lms
|
|
'';
|
|
}
|