build non-gui by default

This commit is contained in:
2025-11-30 04:33:58 -08:00
parent f34e88c490
commit 96242154f7
4 changed files with 141 additions and 54 deletions

View File

@@ -1,10 +1,19 @@
# default.nix
{
lib,
stdenv,
cmake,
installShellFiles,
...
}:
let
pkgs = import <nixpkgs> {};
cmakeContent = builtins.readFile ./CMakeLists.txt;
cmakeLines = lib.splitString "\n" cmakeContent;
versionLine = lib.findFirst (l: builtins.match ".*set\\(KE_VERSION \".+\"\\).*" l
version = builtins.head (builtins.match ".*set\\(KE_VERSION \"(.+)\"\\).*" versio
in
pkgs.stdenv.mkDerivation {
pname = "kte";
version = "0.1.0";
inherit version;
src = ./.;
@@ -17,8 +26,19 @@ pkgs.stdenv.mkDerivation {
];
cmakeFlags = [
"-DBUILD_GUI=ON"
"-DKTE_USE_PIECE_TABLE=ON"
"-DCURSES_NEED_NCURSES=TRUE"
"-DCURSES_NEED_WIDE=TRUE"
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp kte $out/bin/
installManPage ../docs/kte.1
runHook postInstall
'';
}