From c91fe214d6a7fc0e8505f8123eacee5243f5f976 Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Sun, 30 Nov 2025 04:46:10 -0800 Subject: [PATCH] building nix --- default.nix | 22 ++++++++++------------ flake.lock | 38 ++------------------------------------ 2 files changed, 12 insertions(+), 48 deletions(-) diff --git a/default.nix b/default.nix index c5cbb64..6a401af 100644 --- a/default.nix +++ b/default.nix @@ -2,33 +2,31 @@ lib, stdenv, cmake, + ncurses, installShellFiles, ... }: let cmakeContent = builtins.readFile ./CMakeLists.txt; cmakeLines = lib.splitString "\n" cmakeContent; - versionLine = lib.findFirst (l: builtins.match ".*set\\(KTE_VERSION \".+\"\\).*" l - version = builtins.head (builtins.match ".*set\\(KTE_VERSION \"(.+)\"\\).*" versio + versionLine = lib.findFirst (l: builtins.match ".*set\\(KTE_VERSION \".+\"\\).*" l != null) (throw "KTE_VERSION not found in CMakeLists.txt") cmakeLines; + version = builtins.head (builtins.match ".*set\\(KTE_VERSION \"(.+)\"\\).*" versionLine); in -pkgs.stdenv.mkDerivation { - pname = "kte"; +stdenv.mkDerivation { + pname = "ke"; inherit version; - src = ./.; + src = lib.cleanSource ./.; - nativeBuildInputs = [ pkgs.cmake pkgs.pkg-config ]; - buildInputs = with pkgs; [ + nativeBuildInputs = [ + cmake ncurses - SDL2 - libGL - xorg.libX11 + installShellFiles ]; cmakeFlags = [ "-DKTE_USE_PIECE_TABLE=ON" - "-DCURSES_NEED_NCURSES=TRUE" - "-DCURSES_NEED_WIDE=TRUE" + "-DCMAKE_BUILD_TYPE=Debug" ]; installPhase = '' diff --git a/flake.lock b/flake.lock index 113b30e..ee50fc6 100644 --- a/flake.lock +++ b/flake.lock @@ -1,34 +1,16 @@ { "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1764242076, "narHash": "sha256-sKoIWfnijJ0+9e4wRvIgm/HgE27bzwQxcEmo2J/gNpI=", - "owner": "NixOS", + "owner": "nixos", "repo": "nixpkgs", "rev": "2fad6eac6077f03fe109c4d4eb171cf96791faa4", "type": "github" }, "original": { - "owner": "NixOS", + "owner": "nixos", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" @@ -36,24 +18,8 @@ }, "root": { "inputs": { - "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } } }, "root": "root",