Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

insomnia: add aarch64-darwin build, sandbox builds #383533

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
24 changes: 7 additions & 17 deletions pkgs/by-name/in/insomnia/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
stdenv,
fetchurl,
appimageTools,
undmg,
}:
let
pname = "insomnia";
Expand All @@ -11,6 +12,10 @@ let
src =
fetchurl
{
aarch64-darwin = {
url = "https://github.com/Kong/insomnia/releases/download/core%40${version}/Insomnia.Core-${version}.dmg";
hash = "sha256-Yny5Rwt8XHTM77DH4AXmY8VtZ92F7jAdNW+polPePJk=";
};
x86_64-darwin = {
url = "https://github.com/Kong/insomnia/releases/download/core%40${version}/Insomnia.Core-${version}.dmg";
hash = "sha256-Yny5Rwt8XHTM77DH4AXmY8VtZ92F7jAdNW+polPePJk=";
Expand All @@ -29,6 +34,7 @@ let
changelog = "https://github.com/Kong/insomnia/releases/tag/core@${version}";
license = licenses.asl20;
platforms = [
"aarch64-darwin"
"x86_64-linux"
"x86_64-darwin"
];
Expand All @@ -49,23 +55,7 @@ if stdenv.hostPlatform.isDarwin then
;
sourceRoot = ".";

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/Insomnia.app $PWD/
'';
nativeBuildInputs = [ undmg ];

installPhase = ''
runHook preInstall
Expand Down