Skip to content

Commit 76f7b07

Browse files
committed
CI: Disable network accesses by github-pages
In case the Nix sandbox is enabled, the github-metadata plugin automatically disables network accesses. However, if the sandbox is disabled (e.g., on MacOS or by explicitly disabling it), the github-metadata plugin tries to access the GitHub API and (fortunately) fails which aborts the build. As the required patch is currently unreleased, the patch is directly fetched from GitHub. This overlay can be removed as soon as this patch lands in nixpkgs and we update to such a nixpkgs version.
1 parent d8bfef1 commit 76f7b07

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

default.nix

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,24 @@
33
system ? builtins.currentSystem,
44
pkgs ?
55
import sources.nixpkgs {
6-
overlays = [];
6+
overlays = [
7+
(final: previous: {
8+
defaultGemConfig = previous.defaultGemConfig // {
9+
jekyll-github-metadata = attrs: {
10+
dontBuild = false;
11+
patches = [
12+
(final.fetchpatch {
13+
url = "https://github.com/jekyll/github-metadata/commit/17cc5af5e1fd95d98d43676610cc8a47969350ab.patch";
14+
hash = "sha256-dUqvnYsjfG5xQIYS48B3xz0GLVYo2BrDAnYUafmDFKw=";
15+
relative = "lib";
16+
stripLen = 1;
17+
extraPrefix = "lib/jekyll-github-metadata/";
18+
})
19+
];
20+
};
21+
};
22+
})
23+
];
724
config = {};
825
inherit system;
926
},
@@ -93,7 +110,7 @@ pkgs.stdenvNoCC.mkDerivation rec {
93110
if buildGitHubPages
94111
then ''
95112
mvn javadoc:javadoc
96-
JEKYLL_ENV=production PAGES_REPO_NWO=VariantSync/DiffDetective JEKYLL_BUILD_REVISION= github-pages build
113+
JEKYLL_ENV=production PAGES_REPO_NWO=VariantSync/DiffDetective JEKYLL_BUILD_REVISION= PAGES_DISABLE_NETWORK=1 github-pages build
97114
rm -rf _site/target
98115
''
99116
else ""

0 commit comments

Comments
 (0)