From d548a1865876949743af20a1dcbd924b3b0ad8fe Mon Sep 17 00:00:00 2001 From: Ali Caglayan Date: Sun, 22 Oct 2023 23:48:50 -0700 Subject: [PATCH] update nix and add dev shell (#769) We update the lock on the nix flake and also add a dev shell. This means you can do `nix build` to build the project and `nix develop` to drop into a development environment with cmake and clang. Signed-off-by: Ali Caglayan Co-authored-by: ArthurSonzogni --- flake.lock | 30 ++++++++++++++++++++++++------ flake.nix | 25 ++++++++++++++++++++----- 2 files changed, 44 insertions(+), 11 deletions(-) diff --git a/flake.lock b/flake.lock index 750eb53..abe2dae 100644 --- a/flake.lock +++ b/flake.lock @@ -1,12 +1,15 @@ { "nodes": { "flake-utils": { + "inputs": { + "systems": "systems" + }, "locked": { - "lastModified": 1678901627, - "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", "owner": "numtide", "repo": "flake-utils", - "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", "type": "github" }, "original": { @@ -17,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1679734080, - "narHash": "sha256-z846xfGLlon6t9lqUzlNtBOmsgQLQIZvR6Lt2dImk1M=", + "lastModified": 1697915759, + "narHash": "sha256-WyMj5jGcecD+KC8gEs+wFth1J1wjisZf8kVZH13f1Zo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "dbf5322e93bcc6cfc52268367a8ad21c09d76fea", + "rev": "51d906d2341c9e866e48c2efcaac0f2d70bfd43e", "type": "github" }, "original": { @@ -36,6 +39,21 @@ "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", diff --git a/flake.nix b/flake.nix index c9a04b5..e7c7426 100644 --- a/flake.nix +++ b/flake.nix @@ -8,9 +8,11 @@ outputs = {self, nixpkgs, flake-utils}: flake-utils.lib.eachDefaultSystem (system: - let pkgs = import nixpkgs { inherit system; }; in - { - packages.ftxui = pkgs.stdenv.mkDerivation rec { + let pkgs = import nixpkgs { inherit system; }; in + let llvm = pkgs.llvmPackages_latest; in + { + packages = rec { + default = pkgs.stdenv.mkDerivation rec { pname = "ftxui"; version = "v4.0.0"; src = pkgs.fetchFromGitHub { @@ -56,6 +58,19 @@ platforms = pkgs.lib.platforms.all; }; }; - } - ); + + ftxui = default; + }; + + devShells = { + default = pkgs.mkShell { + nativeBuildInputs = [ + pkgs.cmake + pkgs.clang-tools + llvm.clang + ]; + }; + }; + } + ); }