Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 2 additions & 21 deletions pkgs/by-name/lm/lmstudio/darwin.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
stdenv,
fetchurl,
undmg,
_7zz,
meta,
pname,
version,
Expand All @@ -16,7 +16,7 @@ stdenv.mkDerivation {
inherit url hash;
};

nativeBuildInputs = [ undmg ];
nativeBuildInputs = [ _7zz ];

sourceRoot = ".";

Expand All @@ -30,24 +30,5 @@ stdenv.mkDerivation {
# LM Studio ships Scripts inside the App Bundle, which may be messed up by standard fixups
dontFixup = true;

# undmg doesn't support APFS and 7zz does break the xattr. Took that approach from https://github.com/NixOS/nixpkgs/blob/a3c6ed7ad2649c1a55ffd94f7747e3176053b833/pkgs/by-name/in/insomnia/package.nix#L52
unpackCmd = ''
echo "Creating temp directory"
mnt=$(TMPDIR=/tmp mktemp -d -t nix-XXXXXXXXXX)
function finish {
echo "Ejecting temp directory"
/usr/bin/hdiutil detach $mnt -force
rm -rf $mnt
}
# Detach volume when receiving SIG "0"
trap finish EXIT
# Mount DMG file
echo "Mounting DMG file into \"$mnt\""
/usr/bin/hdiutil attach -nobrowse -mountpoint $mnt $curSrc
# Copy content to local dir for later use
echo 'Copying extracted content into "sourceRoot"'
cp -a $mnt/LM\ Studio.app $PWD/
'';

inherit passthru;
}