This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

Use Alejandra to format Nix modules.

+310 -264
+10
.github/workflows/test.yml
··· 147 147 nix_path: nixpkgs=channel:nixos-unstable 148 148 - name: prettier check 149 149 run: nix develop -c prettier --check . 150 + 151 + alejandra: 152 + runs-on: ubuntu-latest 153 + steps: 154 + - uses: actions/checkout@v4 # Check out repo so we can lint it 155 + - uses: cachix/install-nix-action@v24 156 + with: 157 + nix_path: nixpkgs=channel:nixos-unstable 158 + - name: alejandra check 159 + run: nix develop -c alejandra --check .
+28 -1
README.md
··· 492 492 493 493 ### Linting 494 494 495 + #### Prettier 496 + 495 497 Ghostty's docs and resources (not including Zig code) are linted using 496 498 [Prettier](https://prettier.io) with out-of-the-box settings. A Prettier CI 497 499 check will fail builds with improper formatting. Therefore, if you are ··· 502 504 prettier --write . 503 505 ``` 504 506 505 - Make sure your Prettier version matches the version of in [devShell.nix](https://github.com/mitchellh/ghostty/blob/main/nix/devShell.nix). 507 + Make sure your Prettier version matches the version of Prettier in [devShell.nix](https://github.com/mitchellh/ghostty/blob/main/nix/devShell.nix). 508 + 509 + Nix users can use the following command to format with Prettier: 510 + 511 + ``` 512 + nix develop -c prettier --write . 513 + ``` 514 + 515 + #### Alejandra 516 + 517 + Nix modules are formatted with [Alejandra](https://github.com/kamadorueda/alejandra/). An Alejandra CI check 518 + will fail builds with improper formatting. 519 + 520 + Nix users can use the following command to format with Alejanda: 521 + 522 + ``` 523 + nix develop -c alejandra . 524 + ``` 525 + 526 + Non-Nix users should install Alejandra and use the follwing command to format with Alejanda: 527 + 528 + ``` 529 + alejandra . 530 + ``` 531 + 532 + Make sure your Alejandra version matches the version of Alejandra in [devShell.nix](https://github.com/mitchellh/ghostty/blob/main/nix/devShell.nix). 506 533 507 534 ### Nix Package 508 535
+25 -24
flake.nix
··· 31 31 }; 32 32 33 33 outputs = { 34 - nixpkgs-unstable 35 - , nixpkgs-stable 36 - , nixpkgs-zig-0-12 37 - , zig 38 - , zls 39 - , ... 40 - }: builtins.foldl' nixpkgs-stable.lib.recursiveUpdate {} (builtins.map (system: let 41 - pkgs-stable = nixpkgs-stable.legacyPackages.${system}; 42 - pkgs-unstable = nixpkgs-unstable.legacyPackages.${system}; 43 - pkgs-zig-0-12 = nixpkgs-zig-0-12.legacyPackages.${system}; 44 - in { 45 - devShell.${system} = pkgs-stable.callPackage ./nix/devShell.nix { 46 - inherit (pkgs-unstable) tracy; 47 - inherit (zls.packages.${system}) zls; 34 + nixpkgs-unstable, 35 + nixpkgs-stable, 36 + nixpkgs-zig-0-12, 37 + zig, 38 + zls, 39 + ... 40 + }: 41 + builtins.foldl' nixpkgs-stable.lib.recursiveUpdate {} (builtins.map (system: let 42 + pkgs-stable = nixpkgs-stable.legacyPackages.${system}; 43 + pkgs-unstable = nixpkgs-unstable.legacyPackages.${system}; 44 + pkgs-zig-0-12 = nixpkgs-zig-0-12.legacyPackages.${system}; 45 + in { 46 + devShell.${system} = pkgs-stable.callPackage ./nix/devShell.nix { 47 + inherit (pkgs-unstable) tracy; 48 + inherit (zls.packages.${system}) zls; 48 49 49 - zig = zig.packages.${system}.master; 50 - wraptest = pkgs-stable.callPackage ./nix/wraptest.nix {}; 51 - }; 50 + zig = zig.packages.${system}.master; 51 + wraptest = pkgs-stable.callPackage ./nix/wraptest.nix {}; 52 + }; 52 53 53 - packages.${system} = rec { 54 - ghostty = pkgs-stable.callPackage ./nix/package.nix { 55 - inherit (pkgs-zig-0-12) zig_0_12; 54 + packages.${system} = rec { 55 + ghostty = pkgs-stable.callPackage ./nix/package.nix { 56 + inherit (pkgs-zig-0-12) zig_0_12; 57 + }; 58 + default = ghostty; 56 59 }; 57 - default = ghostty; 58 - }; 59 60 60 - # Our supported systems are the same supported systems as the Zig binaries. 61 - }) (builtins.attrNames zig.packages)); 61 + # Our supported systems are the same supported systems as the Zig binaries. 62 + }) (builtins.attrNames zig.packages)); 62 63 }
+131 -125
nix/devShell.nix
··· 1 1 { 2 - mkShell 3 - , lib 4 - , stdenv 5 - 6 - , bashInteractive 7 - , gdb 8 - #, glxinfo # unused 9 - , ncurses 10 - , nodejs 11 - , nodePackages 12 - , oniguruma 13 - , parallel 14 - , pkg-config 15 - , python3 16 - , scdoc 17 - , tracy 18 - , valgrind 19 - #, vulkan-loader # unused 20 - , vttest 21 - , wabt 22 - , wasmtime 23 - , wraptest 24 - , zig 25 - , zip 26 - , zls 27 - , llvmPackages_latest 28 - 29 - , bzip2 30 - , expat 31 - , fontconfig 32 - , freetype 33 - , glib 34 - , gtk4 35 - , libadwaita 36 - , harfbuzz 37 - , libpng 38 - , libGL 39 - , libX11 40 - , libXcursor 41 - , libXext 42 - , libXi 43 - , libXinerama 44 - , libXrandr 45 - , pixman 46 - , zlib 47 - }: 48 - let 2 + mkShell, 3 + lib, 4 + stdenv, 5 + bashInteractive, 6 + gdb, 7 + #, glxinfo # unused 8 + ncurses, 9 + nodejs, 10 + nodePackages, 11 + oniguruma, 12 + parallel, 13 + pkg-config, 14 + python3, 15 + scdoc, 16 + tracy, 17 + valgrind, 18 + #, vulkan-loader # unused 19 + vttest, 20 + wabt, 21 + wasmtime, 22 + wraptest, 23 + zig, 24 + zip, 25 + zls, 26 + llvmPackages_latest, 27 + bzip2, 28 + expat, 29 + fontconfig, 30 + freetype, 31 + glib, 32 + gtk4, 33 + libadwaita, 34 + harfbuzz, 35 + libpng, 36 + libGL, 37 + libX11, 38 + libXcursor, 39 + libXext, 40 + libXi, 41 + libXinerama, 42 + libXrandr, 43 + pixman, 44 + zlib, 45 + alejandra, 46 + }: let 49 47 # See package.nix. Keep in sync. 50 - rpathLibs = [ 51 - libGL 52 - ] ++ lib.optionals stdenv.isLinux [ 53 - bzip2 54 - expat 55 - fontconfig 56 - freetype 57 - harfbuzz 58 - libpng 59 - oniguruma 60 - pixman 61 - zlib 48 + rpathLibs = 49 + [ 50 + libGL 51 + ] 52 + ++ lib.optionals stdenv.isLinux [ 53 + bzip2 54 + expat 55 + fontconfig 56 + freetype 57 + harfbuzz 58 + libpng 59 + oniguruma 60 + pixman 61 + zlib 62 62 63 - libX11 64 - libXcursor 65 - libXi 66 - libXrandr 63 + libX11 64 + libXcursor 65 + libXi 66 + libXrandr 67 67 68 - libadwaita 69 - gtk4 70 - glib 71 - ]; 72 - in mkShell { 73 - name = "ghostty"; 68 + libadwaita 69 + gtk4 70 + glib 71 + ]; 72 + in 73 + mkShell { 74 + name = "ghostty"; 74 75 75 - nativeBuildInputs = [ 76 - # For builds 77 - llvmPackages_latest.llvm 78 - ncurses 79 - pkg-config 80 - scdoc 81 - zig 82 - zip 83 - zls 76 + nativeBuildInputs = 77 + [ 78 + # For builds 79 + llvmPackages_latest.llvm 80 + ncurses 81 + pkg-config 82 + scdoc 83 + zig 84 + zip 85 + zls 84 86 85 - # For web and wasm stuff 86 - nodejs 87 + # For web and wasm stuff 88 + nodejs 87 89 88 - # Linting 89 - nodePackages.prettier 90 + # Linting 91 + nodePackages.prettier 92 + alejandra 90 93 91 - # Testing 92 - parallel 93 - python3 94 - tracy 95 - vttest 94 + # Testing 95 + parallel 96 + python3 97 + tracy 98 + vttest 96 99 97 - # wasm 98 - wabt 99 - wasmtime 100 - ] ++ lib.optionals stdenv.isLinux [ 101 - # My nix shell environment installs the non-interactive version 102 - # by default so we have to include this. 103 - bashInteractive 100 + # wasm 101 + wabt 102 + wasmtime 103 + ] 104 + ++ lib.optionals stdenv.isLinux [ 105 + # My nix shell environment installs the non-interactive version 106 + # by default so we have to include this. 107 + bashInteractive 104 108 105 - gdb 106 - valgrind 107 - wraptest 108 - ]; 109 + gdb 110 + valgrind 111 + wraptest 112 + ]; 109 113 110 - buildInputs = [ 111 - # TODO: non-linux 112 - ] ++ lib.optionals stdenv.isLinux [ 113 - bzip2 114 - expat 115 - fontconfig 116 - freetype 117 - harfbuzz 118 - libpng 119 - oniguruma 120 - pixman 121 - zlib 114 + buildInputs = 115 + [ 116 + # TODO: non-linux 117 + ] 118 + ++ lib.optionals stdenv.isLinux [ 119 + bzip2 120 + expat 121 + fontconfig 122 + freetype 123 + harfbuzz 124 + libpng 125 + oniguruma 126 + pixman 127 + zlib 122 128 123 - libX11 124 - libXcursor 125 - libXext 126 - libXi 127 - libXinerama 128 - libXrandr 129 + libX11 130 + libXcursor 131 + libXext 132 + libXi 133 + libXinerama 134 + libXrandr 129 135 130 - # Only needed for GTK builds 131 - libadwaita 132 - gtk4 133 - glib 134 - ]; 136 + # Only needed for GTK builds 137 + libadwaita 138 + gtk4 139 + glib 140 + ]; 135 141 136 - # This should be set onto the rpath of the ghostty binary if you want 137 - # it to be "portable" across the system. 138 - LD_LIBRARY_PATH = lib.makeLibraryPath rpathLibs; 139 - } 142 + # This should be set onto the rpath of the ghostty binary if you want 143 + # it to be "portable" across the system. 144 + LD_LIBRARY_PATH = lib.makeLibraryPath rpathLibs; 145 + }
+101 -101
nix/package.nix
··· 1 1 { 2 - lib 3 - , stdenv 4 - 5 - , bzip2 6 - , expat 7 - , fontconfig 8 - , freetype 9 - , harfbuzz 10 - , libpng 11 - , pixman 12 - , zlib 13 - 14 - , libGL 15 - , libX11 16 - , libXcursor 17 - , libXi 18 - , libXrandr 19 - 20 - , glib 21 - , gtk4 22 - , libadwaita 23 - 24 - , git 25 - , ncurses 26 - , pkg-config 27 - , zig_0_12 2 + lib, 3 + stdenv, 4 + bzip2, 5 + expat, 6 + fontconfig, 7 + freetype, 8 + harfbuzz, 9 + libpng, 10 + pixman, 11 + zlib, 12 + libGL, 13 + libX11, 14 + libXcursor, 15 + libXi, 16 + libXrandr, 17 + glib, 18 + gtk4, 19 + libadwaita, 20 + git, 21 + ncurses, 22 + pkg-config, 23 + zig_0_12, 28 24 }: let 29 25 # The Zig hook has no way to select the release type without actual 30 26 # overriding of the default flags. ··· 51 47 # derivation in your store already. If so, just update the value as above.) 52 48 zigCacheHash = import ./zigCacheHash.nix; 53 49 54 - zigCache = src: stdenv.mkDerivation { 55 - inherit src; 56 - name = "ghostty-cache"; 57 - nativeBuildInputs = [ git zig_0_12.hook ]; 50 + zigCache = src: 51 + stdenv.mkDerivation { 52 + inherit src; 53 + name = "ghostty-cache"; 54 + nativeBuildInputs = [git zig_0_12.hook]; 58 55 59 - dontConfigure = true; 60 - dontUseZigBuild = true; 61 - dontUseZigInstall = true; 62 - dontFixup = true; 56 + dontConfigure = true; 57 + dontUseZigBuild = true; 58 + dontUseZigInstall = true; 59 + dontFixup = true; 63 60 64 - buildPhase = '' 65 - runHook preBuild 61 + buildPhase = '' 62 + runHook preBuild 66 63 67 - zig build --fetch 64 + zig build --fetch 68 65 69 - runHook postBuild 70 - ''; 66 + runHook postBuild 67 + ''; 71 68 72 - installPhase = '' 73 - runHook preInstall 69 + installPhase = '' 70 + runHook preInstall 74 71 75 - cp -r --reflink=auto $ZIG_GLOBAL_CACHE_DIR $out 72 + cp -r --reflink=auto $ZIG_GLOBAL_CACHE_DIR $out 76 73 77 - runHook postInstall 78 - ''; 74 + runHook postInstall 75 + ''; 79 76 80 - outputHashMode = "recursive"; 81 - outputHash = zigCacheHash; 82 - }; 83 - in stdenv.mkDerivation (finalAttrs: { 84 - pname = "ghostty"; 85 - version = "0.1.0"; 77 + outputHashMode = "recursive"; 78 + outputHash = zigCacheHash; 79 + }; 80 + in 81 + stdenv.mkDerivation (finalAttrs: { 82 + pname = "ghostty"; 83 + version = "0.1.0"; 86 84 87 - src = ./..; 85 + src = ./..; 88 86 89 - nativeBuildInputs = [ 90 - git 91 - ncurses 92 - pkg-config 93 - zig012Hook 94 - ]; 87 + nativeBuildInputs = [ 88 + git 89 + ncurses 90 + pkg-config 91 + zig012Hook 92 + ]; 95 93 96 - buildInputs = [ 97 - libGL 98 - ] ++ lib.optionals stdenv.isLinux [ 99 - bzip2 100 - expat 101 - fontconfig 102 - freetype 103 - harfbuzz 104 - libpng 105 - pixman 106 - zlib 94 + buildInputs = 95 + [ 96 + libGL 97 + ] 98 + ++ lib.optionals stdenv.isLinux [ 99 + bzip2 100 + expat 101 + fontconfig 102 + freetype 103 + harfbuzz 104 + libpng 105 + pixman 106 + zlib 107 107 108 - libX11 109 - libXcursor 110 - libXi 111 - libXrandr 108 + libX11 109 + libXcursor 110 + libXi 111 + libXrandr 112 112 113 - libadwaita 114 - gtk4 115 - glib 116 - ]; 113 + libadwaita 114 + gtk4 115 + glib 116 + ]; 117 117 118 - dontConfigure = true; 118 + dontConfigure = true; 119 119 120 - zigBuildFlags = "-Dversion-string=${finalAttrs.version}"; 120 + zigBuildFlags = "-Dversion-string=${finalAttrs.version}"; 121 121 122 - preBuild = '' 123 - rm -rf $ZIG_GLOBAL_CACHE_DIR 124 - cp -r --reflink=auto ${zigCache finalAttrs.src} $ZIG_GLOBAL_CACHE_DIR 125 - chmod u+rwX -R $ZIG_GLOBAL_CACHE_DIR 126 - ''; 122 + preBuild = '' 123 + rm -rf $ZIG_GLOBAL_CACHE_DIR 124 + cp -r --reflink=auto ${zigCache finalAttrs.src} $ZIG_GLOBAL_CACHE_DIR 125 + chmod u+rwX -R $ZIG_GLOBAL_CACHE_DIR 126 + ''; 127 127 128 - outputs = [ "out" "terminfo" "shell_integration" ]; 128 + outputs = ["out" "terminfo" "shell_integration"]; 129 129 130 - postInstall = '' 131 - terminfo_src=${ 132 - if stdenv.isDarwin 133 - then ''"$out/Applications/Ghostty.app/Contents/Resources/terminfo"'' 134 - else "$out/share/terminfo" 135 - } 130 + postInstall = '' 131 + terminfo_src=${ 132 + if stdenv.isDarwin 133 + then ''"$out/Applications/Ghostty.app/Contents/Resources/terminfo"'' 134 + else "$out/share/terminfo" 135 + } 136 136 137 - mkdir -p $terminfo/share 138 - cp -r "$terminfo_src" $terminfo/share/terminfo 137 + mkdir -p $terminfo/share 138 + cp -r "$terminfo_src" $terminfo/share/terminfo 139 139 140 - mkdir -p $shell_integration 141 - cp -r $out/share/shell-integration $shell_integration/shell-integration 142 - ''; 140 + mkdir -p $shell_integration 141 + cp -r $out/share/shell-integration $shell_integration/shell-integration 142 + ''; 143 143 144 - meta = with lib; { 145 - homepage = "https://github.com/mitchellh/ghostty"; 146 - license = licenses.mit; 147 - platforms = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ]; 148 - }; 149 - }) 144 + meta = with lib; { 145 + homepage = "https://github.com/mitchellh/ghostty"; 146 + license = licenses.mit; 147 + platforms = ["x86_64-linux" "aarch64-linux" "aarch64-darwin"]; 148 + }; 149 + })
+4 -5
nix/wraptest.nix
··· 1 1 { 2 - stdenv 3 - , fetchFromGitHub 4 - , autoPatchelfHook 2 + stdenv, 3 + fetchFromGitHub, 4 + autoPatchelfHook, 5 5 }: 6 - 7 6 stdenv.mkDerivation rec { 8 7 version = "0.1.0-e7a96089"; 9 8 pname = "wraptest"; ··· 39 38 meta = { 40 39 description = "Test of DEC VT terminal line-wrapping semantics"; 41 40 homepage = "https://github.com/mattiase/wraptest"; 42 - platforms = [ "aarch64-linux" "i686-linux" "x86_64-linux" ]; 41 + platforms = ["aarch64-linux" "i686-linux" "x86_64-linux"]; 43 42 }; 44 43 }
+11 -8
shell.nix
··· 1 1 (import 2 - ( 3 - let flake-compat = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.flake-compat; in 4 - fetchTarball { 5 - url = "https://github.com/edolstra/flake-compat/archive/${flake-compat.locked.rev}.tar.gz"; 6 - sha256 = flake-compat.locked.narHash; 7 - } 8 - ) 9 - { src = ./.; }).shellNix 2 + ( 3 + let 4 + flake-compat = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.flake-compat; 5 + in 6 + fetchTarball { 7 + url = "https://github.com/edolstra/flake-compat/archive/${flake-compat.locked.rev}.tar.gz"; 8 + sha256 = flake-compat.locked.narHash; 9 + } 10 + ) 11 + {src = ./.;}) 12 + .shellNix