diff options
| author | Theofilos Augoustis <theofilos.augoustis@gmail.com> | 2025-10-21 09:03:21 +0000 |
|---|---|---|
| committer | Theofilos Augoustis <theofilos.augoustis@gmail.com> | 2025-10-21 09:14:13 +0000 |
| commit | c6a2f0793963c6146a1fe14243831615ddb611e3 (patch) | |
| tree | d46f67ad20660e58fc43ce92cf5738ed1310b3e4 /flake.nix | |
| parent | ce41eb0f446f703f632a702863debe508111a90c (diff) | |
| download | focaccia-c6a2f0793963c6146a1fe14243831615ddb611e3.tar.gz focaccia-c6a2f0793963c6146a1fe14243831615ddb611e3.zip | |
Update flake to check for missing git submodules
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix index 1dce778..425040b 100644 --- a/flake.nix +++ b/flake.nix @@ -200,15 +200,31 @@ export REPO_ROOT=$(git rev-parse --show-toplevel) ''; + checkSubmodulesInitialized = '' + if ! ${pkgs.git} submodule status --recursive >/dev/null 2>&1; then + printf 'Error: git submodules not initialized correctly, build cannot proceed\n' + printf 'Run git submodule update --init --recursive and then rebuild\n' + exit 2 + fi + ''; + gdbInternal = pkgs.gdb.override { python3 = python; }; in rec { # Default package just builds Focaccia packages = rec { focaccia = pythonEnv.overrideAttrs (old: { + buildPhase = '' + ${checkSubmodulesInitialized} + ${old.buildPhase or ""} + ''; propagatedBuildInputs = (old.propagatedBuildInputs or []) ++ [ pkgs.lldb ]; }); dev = pythonDevEnv.overrideAttrs (old: { + buildPhase = '' + ${checkSubmodulesInitialized} + ${old.buildPhase or ""} + ''; propagatedBuildInputs = (old.propagatedBuildInputs or []) ++ [ pkgs.uv pkgs.lldb |