From e2eee2bc7ca87bbf17528c50aa55eef314de75d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Fri, 10 Jan 2025 14:14:06 +0100 Subject: [PATCH] add submodule assert MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- nix/default.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/nix/default.nix b/nix/default.nix index 7830babf..37ce9f00 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -17,18 +17,21 @@ ).packages.${builtins.currentSystem}.default }: +assert pkgs.lib.assertMsg ((src.submodules or 1) == 1) + "Unable to build without submodules. Append '?submodules=1#' to the URI."; + let inherit (pkgs) stdenv lib writeScriptBin callPackage; - + revision = lib.substring 0 8 (src.rev or "dirty"); tools = callPackage ./tools.nix {}; in pkgs.gcc11Stdenv.mkDerivation rec { - + pname = "codex"; version = "${tools.findKeyValue "version = \"([0-9]+\.[0-9]+\.[0-9]+)\"" ../codex.nimble}-${revision}"; - + #src = pkgs.fetchFromGitHub { # owner = "codex-storage"; # repo = "nim-codex"; @@ -77,7 +80,7 @@ in pkgs.gcc11Stdenv.mkDerivation rec { configurePhase = '' patchShebangs . > /dev/null ''; - + installPhase = '' mkdir -p $out/bin cp build/codex $out/bin/