From 94bc0f0472a5e52277e33dc071710cf61ee29813 Mon Sep 17 00:00:00 2001 From: Kevin Yue Date: Wed, 7 Oct 2026 00:42:10 +0800 Subject: [PATCH] fix(nix): scope submodule fetching to source builds --- .github/workflows/nix.yaml | 2 +- README.md | 4 ++-- flake.nix | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nix.yaml b/.github/workflows/nix.yaml index d2ab38a..0608239 100644 --- a/.github/workflows/nix.yaml +++ b/.github/workflows/nix.yaml @@ -43,7 +43,7 @@ jobs: - name: Build current source package run: | - nix build .#fromSource \ + nix build "git+file://$PWD?submodules=1#fromSource" \ --extra-experimental-features "nix-command flakes" \ --print-build-logs diff --git a/README.md b/README.md index a66667a..a4bedb3 100644 --- a/README.md +++ b/README.md @@ -310,10 +310,10 @@ The `prebuilt` package and NixOS module use the published release pinned in `fla ```bash git submodule update --init --recursive -nix build .#fromSource +nix build "git+file://$PWD?submodules=1#fromSource" ``` -Source builds require Nix 2.27 or later for automatic submodule fetching. For a remote source flake, use a Git URL with submodules enabled, such as `git+https://github.com/yuezk/GlobalProtect-openconnect?submodules=1#fromSource`. Build output (`target`, `.build`, and `node_modules`) is excluded from the source input. Updating release asset hashes changes the prebuilt package, independently of source builds. +Local source builds require initialized Git submodules and a flake URL with `submodules=1`, as shown above. For a remote source flake, use a Git URL with submodules enabled, such as `git+https://github.com/yuezk/GlobalProtect-openconnect?submodules=1#fromSource`. The `prebuilt` package and NixOS module do not require Git submodules. Build output (`target`, `.build`, and `node_modules`) is excluded from the source input. Updating release asset hashes changes the prebuilt package, independently of source builds. ### Official Docker Image diff --git a/flake.nix b/flake.nix index 8b1c3c4..44d52c0 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,5 @@ { inputs = { - self.submodules = true; nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; flake-utils.url = "github:numtide/flake-utils"; naersk = {