-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0bc91a7
commit 67fff2f
Showing
3 changed files
with
135 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{ | ||
pname, | ||
version, | ||
outputs, | ||
meta, | ||
lib, | ||
stdenvNoCC, | ||
fetchurl, | ||
_7zz, | ||
makeWrapper, | ||
}: | ||
|
||
stdenvNoCC.mkDerivation (finalAttrs: { | ||
inherit pname version outputs; | ||
|
||
src = fetchurl { | ||
url = "https://release.files.ghostty.org/${finalAttrs.version}/Ghostty.dmg"; | ||
sha256 = "sha256-CR96Kz9BYKFtfVKygiEku51XFJk4FfYqfXACeYQ3JlI="; | ||
}; | ||
|
||
nativeBuildInputs = [ | ||
_7zz | ||
makeWrapper | ||
]; | ||
|
||
sourceRoot = "."; | ||
installPhase = '' | ||
runHook preInstall | ||
mkdir -p $out/Applications | ||
mv Ghostty.app $out/Applications/ | ||
makeWrapper $out/Applications/Ghostty.app/Contents/MacOS/ghostty $out/bin/ghostty | ||
runHook postInstall | ||
''; | ||
|
||
postFixup = | ||
let | ||
resources = "$out/Applications/Ghostty.app/Contents/Resources"; | ||
in | ||
'' | ||
mkdir -p $man/share | ||
ln -s ${resources}/man $man/share/man | ||
mkdir -p $terminfo/share | ||
ln -s ${resources}/terminfo $terminfo/share/terminfo | ||
mkdir -p $shell_integration | ||
for folder in "${resources}/ghostty/shell-integration"/*; do | ||
ln -s $folder $shell_integration/$(basename "$folder") | ||
done | ||
mkdir -p $vim | ||
for folder in "${resources}/vim/vimfiles"/*; do | ||
ln -s $folder $vim/$(basename "$folder") | ||
done | ||
''; | ||
|
||
meta = meta // { | ||
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ]; | ||
}; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
stdenvNoCC, | ||
callPackage, | ||
lib, | ||
}: | ||
|
||
let | ||
pname = "ghostty"; | ||
version = "1.0.0"; | ||
outputs = [ | ||
"out" | ||
"man" | ||
"shell_integration" | ||
"terminfo" | ||
"vim" | ||
]; | ||
meta = { | ||
description = "Fast, native, feature-rich terminal emulator pushing modern features"; | ||
longDescription = '' | ||
Ghostty is a terminal emulator that differentiates itself by being | ||
fast, feature-rich, and native. While there are many excellent terminal | ||
emulators available, they all force you to choose between speed, | ||
features, or native UIs. Ghostty provides all three. | ||
''; | ||
homepage = "https://ghostty.org/"; | ||
downloadPage = "https://ghostty.org/download"; | ||
|
||
license = lib.licenses.mit; | ||
mainProgram = "ghostty"; | ||
maintainers = with lib.maintainers; [ | ||
jcollie | ||
pluiedev | ||
getchoo | ||
DimitarNestorov | ||
]; | ||
outputsToInstall = [ | ||
"out" | ||
"man" | ||
"shell_integration" | ||
"terminfo" | ||
]; | ||
platforms = lib.platforms.linux ++ lib.platforms.darwin; | ||
}; | ||
in | ||
|
||
if stdenvNoCC.hostPlatform.isDarwin then | ||
callPackage ./darwin.nix { | ||
inherit | ||
pname | ||
version | ||
outputs | ||
meta | ||
; | ||
} | ||
else | ||
callPackage ./linux.nix { | ||
inherit | ||
pname | ||
version | ||
outputs | ||
meta | ||
; | ||
} |