fix(nix): scope submodule fetching to source builds

This commit is contained in:
Kevin Yue committed 2026-10-07 00:42:10 +08:00
1 parent 94b04add4f
commit 94bc0f0472
3 files changed
+3 -4

No files matched your search

+1 -1
View File
@@ -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
+2 -2
View File
@@ -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
-1
View File
@@ -1,6 +1,5 @@
{
inputs = {
self.submodules = true;
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
naersk = {