From 8a24971c7f38fe03edd7de0da4d55779e697ffc6 Mon Sep 17 00:00:00 2001 From: Benjamin Moosherr Date: Sat, 11 Jan 2025 18:19:38 +0100 Subject: [PATCH] Test if network is available --- default.nix | 11 ++++++++++- test.patch | 20 ++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 test.patch diff --git a/default.nix b/default.nix index cab1125a..515c1e25 100644 --- a/default.nix +++ b/default.nix @@ -3,7 +3,16 @@ system ? builtins.currentSystem, pkgs ? import sources.nixpkgs { - overlays = []; + overlays = [ + (final: previous: { + defaultGemConfig = previous.defaultGemConfig // { + jekyll-github-metadata = attrs: { + dontBuild = false; + patches = [./test.patch]; + }; + }; + }) + ]; config = {}; inherit system; }, diff --git a/test.patch b/test.patch new file mode 100644 index 00000000..013b6338 --- /dev/null +++ b/test.patch @@ -0,0 +1,20 @@ +diff --git a/lib/jekyll-github-metadata/client.rb b/lib/jekyll-github-metadata/client.rb +index f655152..6be3d4c 100644 +--- a/lib/jekyll-github-metadata/client.rb ++++ b/lib/jekyll-github-metadata/client.rb +@@ -108,6 +108,7 @@ module Jekyll + end + + def internet_connected? ++ GitHubMetadata.log :warn, " ----------- checking for an internet connection #{@internet_connected}" + return @internet_connected if defined?(@internet_connected) + + require "resolv" +@@ -120,6 +121,7 @@ module Jekyll + rescue Resolv::ResolvError + @internet_connected = false + end ++ GitHubMetadata.log :warn, " ----------- checked for an internet connection #{@internet_connected}" + end + + private