From aa3a056b4ae5ea6d5d4822a08faa9630dca71cc6 Mon Sep 17 00:00:00 2001 From: maralorn Date: Mon, 16 Jan 2023 03:06:03 +0100 Subject: [PATCH] Fix build on hera --- overlays/10-previews.nix | 2 -- overlays/mastodon-digest/all-posts.patch | 6 ++--- overlays/mastodon-digest/default.nix | 8 +++---- overlays/nixpkgs-bot/default.nix | 30 ++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 9 deletions(-) create mode 100644 overlays/nixpkgs-bot/default.nix diff --git a/overlays/10-previews.nix b/overlays/10-previews.nix index 67275a97..bc6fc14a 100644 --- a/overlays/10-previews.nix +++ b/overlays/10-previews.nix @@ -15,7 +15,5 @@ in { emanote helix ; - nixpkgs-bot = (myFlake "nixpkgs-bot").default; nix-output-monitor = (myFlake "nix-output-monitor").default; - inherit (myFlake "mastodon_digest") mastodon_digest; } diff --git a/overlays/mastodon-digest/all-posts.patch b/overlays/mastodon-digest/all-posts.patch index 340254d0..1ce11f6b 100644 --- a/overlays/mastodon-digest/all-posts.patch +++ b/overlays/mastodon-digest/all-posts.patch @@ -2,12 +2,12 @@ diff --git a/thresholds.py b/thresholds.py index 8d7f114..0802ff6 100644 --- a/thresholds.py +++ b/thresholds.py -@@ -11,8 +11,6 @@ if TYPE_CHECKING: +@@ -11,6 +11,8 @@ if TYPE_CHECKING: class Threshold(Enum): -- ALL = 0 -- HALF = 50 ++ ALL = 0 ++ HALF = 50 LAX = 90 NORMAL = 95 STRICT = 98 diff --git a/overlays/mastodon-digest/default.nix b/overlays/mastodon-digest/default.nix index 5646696e..c6d96c42 100644 --- a/overlays/mastodon-digest/default.nix +++ b/overlays/mastodon-digest/default.nix @@ -14,10 +14,10 @@ final: prev: let rev = "07d8827a79086263f0e0f161faa2c12e405b2929"; hash = "sha256-iFOvexzj5UQve67nvNcGthrvVbL5yQbYyUIXlaRYlug="; }; - patchedSrc = pkgs.runCommand "mastodon_digest-patched-src" '' { } - cp -r ${src} $out - chmod -R +w $out - patch -d $out -p1 < ${./all-posts.patch} + patchedSrc = pkgs.runCommand "mastodon_digest-patched-src" {} '' + cp -r ${src} $out + chmod -R +w $out + patch -d $out -p1 < ${./all-posts.patch} ''; in { mastodon_digest = pkgs.writeShellApplication { diff --git a/overlays/nixpkgs-bot/default.nix b/overlays/nixpkgs-bot/default.nix new file mode 100644 index 00000000..b63f77b8 --- /dev/null +++ b/overlays/nixpkgs-bot/default.nix @@ -0,0 +1,30 @@ +final: prev: let + inherit (final) lib; + inherit (final.haskell.lib.compose) justStaticExecutables dontCheck markUnbroken appendPatch; + haskellPackages = final.haskellPackages.override { + overrides = hfinal: hprev: { + matrix-client = + appendPatch (final.fetchpatch { + url = "https://github.com/softwarefactory-project/matrix-client-haskell/commit/97cb1918fcdf9b0249c6c8e70c7bfc664d718022.patch"; + sha256 = "sha256-YyxgfNO5RtqpKJ9UOYPlRple0FuNmjAB1iy9vYy0HOE="; + relative = "matrix-client"; + }) + hprev.matrix-client; + aeson-schemas = markUnbroken (dontCheck hprev.aeson-schemas); + }; + }; + cleanSelf = lib.sourceFilesBySuffices ../../apps/nixpkgs-bot [ + ".hs" + ".cabal" + "CHANGELOG.md" + "LICENSE" + ]; +in { + nixpkgs-bot = + lib.pipe {} + [ + (haskellPackages.callCabal2nix "nixpkgs-bot" cleanSelf) + haskellPackages.buildFromCabalSdist + justStaticExecutables + ]; +}