nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 fetchzip,
3 lib,
4 stdenvNoCC,
5}:
6
7/*
8 This cannot be built from source as it requires entitlements and
9 for that it needs to be code signed. Automatic updates will have
10 to be disabled via preferences instead of at build time. To do
11 that edit $HOME/Library/Preferences/com.googlecode.iterm2.plist
12 and add:
13 SUEnableAutomaticChecks = 0;
14*/
15
16stdenvNoCC.mkDerivation rec {
17 pname = "iterm2";
18 version = "3.6.6";
19
20 src = fetchzip {
21 url = "https://iterm2.com/downloads/stable/iTerm2-${
22 lib.replaceStrings [ "." ] [ "_" ] version
23 }.zip";
24 hash = "sha256-n3VoRxMOBQK/8mbVbORSBz73tsuKAUMG7dFZIbaqdHU=";
25 };
26
27 dontFixup = true;
28
29 installPhase = ''
30 runHook preInstall
31 APP_DIR="$out/Applications/iTerm2.app"
32 mkdir -p "$APP_DIR"
33 cp -r . "$APP_DIR"
34 mkdir -p "$out/bin"
35 cat << EOF > "$out/bin/iterm2"
36 #!${stdenvNoCC.shell}
37 open -na "$APP_DIR" --args "\$@"
38 EOF
39 chmod +x "$out/bin/iterm2"
40 runHook postInstall
41 '';
42
43 passthru.updateScript = ./update.sh;
44
45 meta = {
46 description = "Replacement for Terminal and the successor to iTerm";
47 homepage = "https://www.iterm2.com/";
48 hydraPlatforms = [ ]; # The build is little more than copying the binary
49 license = lib.licenses.gpl2;
50 maintainers = with lib.maintainers; [
51 tricktron
52 emaiax
53 ];
54 platforms = [
55 "x86_64-darwin"
56 "aarch64-darwin"
57 ];
58 sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
59 };
60}