nixpkgs/pkgs/applications/editors/jetbrains/darwin.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

41 lines
706 B
Nix
Raw Normal View History

2022-02-01 02:40:45 +00:00
{ lib
, stdenvNoCC
, undmg
, ...
}:
{ meta
2022-03-22 16:57:23 +00:00
, pname
2022-02-01 02:40:45 +00:00
, product
, productShort ? product
, src
, version
2023-03-28 15:23:01 +00:00
, plugins ? [ ]
, buildNumber
2022-02-01 02:40:45 +00:00
, ...
}:
let
loname = lib.toLower productShort;
in
2023-03-28 15:23:01 +00:00
stdenvNoCC.mkDerivation {
inherit pname meta src version plugins;
passthru.buildNumber = buildNumber;
desktopName = product;
dontFixup = true;
2023-03-28 15:23:01 +00:00
installPhase = ''
runHook preInstall
APP_DIR="$out/Applications/${product}.app"
mkdir -p "$APP_DIR"
cp -Tr *.app "$APP_DIR"
2023-03-28 15:23:01 +00:00
mkdir -p "$out/bin"
cat << EOF > "$out/bin/${loname}"
open -na '$APP_DIR' --args "\$@"
EOF
chmod +x "$out/bin/${loname}"
runHook postInstall
'';
nativeBuildInputs = [ undmg ];
sourceRoot = ".";
}