From 702f54a6fa5487499a65bda5dad267e52f9af95f Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 26 Jul 2022 11:38:54 -0700 Subject: [PATCH] first attempt at a derivation --- flake.nix | 2 ++ nix/overlay.nix | 1 + nix/package.nix | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 nix/package.nix diff --git a/flake.nix b/flake.nix index e294dca89..bb01913c2 100644 --- a/flake.nix +++ b/flake.nix @@ -32,6 +32,8 @@ let pkgs = import nixpkgs { inherit overlays system; }; in rec { devShell = pkgs.devShell; + packages.ghostty = pkgs.ghostty; + defaultPackage = packages.ghostty; } ); } diff --git a/nix/overlay.nix b/nix/overlay.nix index 4918d0d77..0f3fbc3af 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -8,6 +8,7 @@ final: prev: rec { # devShell = prev.callPackage ./devshell.nix { }; + ghostty = prev.callPackage ./package.nix { }; wraptest = prev.callPackage ./wraptest.nix { }; diff --git a/nix/package.nix b/nix/package.nix new file mode 100644 index 000000000..fcf447b55 --- /dev/null +++ b/nix/package.nix @@ -0,0 +1,35 @@ +{ stdenv +, lib +, zig +}: + +stdenv.mkDerivation rec { + pname = "ghostty"; + version = "0.1.0"; + + src = ./..; + + nativeBuildInputs = [ zig ]; + + buildInputs = []; + + dontConfigure = true; + + # preBuild = '' + # export HOME=$TMPDIR + # ''; + + installPhase = '' + runHook preInstall + zig build -Drelease-safe --prefix $out install + runHook postInstall + ''; + + outputs = [ "out" ]; + + meta = with lib; { + homepage = "https://github.com/mitchellh/ghostty"; + license = licenses.mit; + platforms = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ]; + }; +}