From ef88b3b991e5e30e6ffca6433676d9fa0552d76c Mon Sep 17 00:00:00 2001 From: cy Date: Sun, 5 Jan 2025 16:45:18 -0500 Subject: [PATCH] patch over main to fix conduwuit --- flake.nix | 25 +---------- overlay/conduwuit/default.nix | 27 ++++++++++++ overlay/conduwuit/fix-lint.patch | 74 ++++++++++++++++++++++++++++++++ overlay/default.nix | 7 +++ 4 files changed, 109 insertions(+), 24 deletions(-) create mode 100644 overlay/conduwuit/default.nix create mode 100644 overlay/conduwuit/fix-lint.patch create mode 100644 overlay/default.nix diff --git a/flake.nix b/flake.nix index 66d3e70..6ddf598 100644 --- a/flake.nix +++ b/flake.nix @@ -79,30 +79,7 @@ (overlayPkgsFromFlake inputs.nixpkgs-stable [ # "prometheus" # fails to build on unstable ]) - (_final: prev: { - conduwuit = prev.conduwuit.override (old: { - rustPlatform = old.rustPlatform // { - buildRustPackage = - args: - old.rustPlatform.buildRustPackage ( - args - // { - version = "0.5.0-rc2"; - src = prev.fetchFromGitHub { - owner = "girlbossceo"; - repo = "conduwuit"; - rev = "33d9e8d304a5fe6928fe0c479a5ad9dc87fe09e4"; - hash = "sha256-WThyGzZtADuMQhUzkt+9559jo8hGPyyVxRTXdWHQ+0I="; - }; - doCheck = false; - cargoHash = "sha256-ZenMTCEJrALKQnW7/eXqrhFj+BedE9i/rQZMsPHl8K0="; - meta.mainProgram = "conduwuit"; - } - ); - }; - }); - }) - ]; + ] ++ import ./overlay; pkgsFor = lib.genAttrs systems ( system: diff --git a/overlay/conduwuit/default.nix b/overlay/conduwuit/default.nix new file mode 100644 index 0000000..cb2502a --- /dev/null +++ b/overlay/conduwuit/default.nix @@ -0,0 +1,27 @@ +final: prev: { + conduwuit = prev.conduwuit.override (old: { + rustPlatform = old.rustPlatform // { + buildRustPackage = + args: + old.rustPlatform.buildRustPackage ( + args + // rec { + version = "0.5.0-rc2"; + src = final.fetchFromGitHub { + owner = "girlbossceo"; + repo = "conduwuit"; + rev = "v${version}"; + hash = "sha256-xnwqhU3yOIyWRrD/Pq3jmUHoNZSY8Ms9h8OTsZVYQ1g="; + }; + doCheck = false; + cargoHash = "sha256-ZenMTCEJrALKQnW7/eXqrhFj+BedE9i/rQZMsPHl8K0="; + cargoPatches = [ + ./fix-lint.patch + ]; + # unstable has this set to "conduit" + meta.mainProgram = "conduwuit"; + } + ); + }; + }); +} diff --git a/overlay/conduwuit/fix-lint.patch b/overlay/conduwuit/fix-lint.patch new file mode 100644 index 0000000..120ec8a --- /dev/null +++ b/overlay/conduwuit/fix-lint.patch @@ -0,0 +1,74 @@ +diff --git a/Cargo.lock b/Cargo.lock +index 3f900a114..0d30a3fec 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -4493,7 +4493,7 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + [[package]] + name = "tracing" + version = "0.1.41" +-source = "git+https://github.com/girlbossceo/tracing?rev=ccc4fbd8238c2d5ba354e61ec17ac610af11401d#ccc4fbd8238c2d5ba354e61ec17ac610af11401d" ++source = "git+https://github.com/girlbossceo/tracing?rev=3cf1c991e3660785d3855a34245949557db33209#3cf1c991e3660785d3855a34245949557db33209" + dependencies = [ + "log", + "pin-project-lite", +@@ -4504,7 +4504,7 @@ dependencies = [ + [[package]] + name = "tracing-attributes" + version = "0.1.28" +-source = "git+https://github.com/girlbossceo/tracing?rev=ccc4fbd8238c2d5ba354e61ec17ac610af11401d#ccc4fbd8238c2d5ba354e61ec17ac610af11401d" ++source = "git+https://github.com/girlbossceo/tracing?rev=3cf1c991e3660785d3855a34245949557db33209#3cf1c991e3660785d3855a34245949557db33209" + dependencies = [ + "proc-macro2", + "quote", +@@ -4514,7 +4514,7 @@ dependencies = [ + [[package]] + name = "tracing-core" + version = "0.1.33" +-source = "git+https://github.com/girlbossceo/tracing?rev=ccc4fbd8238c2d5ba354e61ec17ac610af11401d#ccc4fbd8238c2d5ba354e61ec17ac610af11401d" ++source = "git+https://github.com/girlbossceo/tracing?rev=3cf1c991e3660785d3855a34245949557db33209#3cf1c991e3660785d3855a34245949557db33209" + dependencies = [ + "once_cell", + "valuable", +@@ -4534,7 +4534,7 @@ dependencies = [ + [[package]] + name = "tracing-log" + version = "0.2.0" +-source = "git+https://github.com/girlbossceo/tracing?rev=ccc4fbd8238c2d5ba354e61ec17ac610af11401d#ccc4fbd8238c2d5ba354e61ec17ac610af11401d" ++source = "git+https://github.com/girlbossceo/tracing?rev=3cf1c991e3660785d3855a34245949557db33209#3cf1c991e3660785d3855a34245949557db33209" + dependencies = [ + "log", + "once_cell", +@@ -4562,7 +4562,7 @@ dependencies = [ + [[package]] + name = "tracing-subscriber" + version = "0.3.18" +-source = "git+https://github.com/girlbossceo/tracing?rev=ccc4fbd8238c2d5ba354e61ec17ac610af11401d#ccc4fbd8238c2d5ba354e61ec17ac610af11401d" ++source = "git+https://github.com/girlbossceo/tracing?rev=3cf1c991e3660785d3855a34245949557db33209#3cf1c991e3660785d3855a34245949557db33209" + dependencies = [ + "matchers", + "nu-ansi-term", +diff --git a/Cargo.toml b/Cargo.toml +index 76acda807..a2916a6aa 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -513,16 +513,16 @@ version = "0.2" + # https://github.com/girlbossceo/tracing/commit/b348dca742af641c47bc390261f60711c2af573c + [patch.crates-io.tracing-subscriber] + git = "https://github.com/girlbossceo/tracing" +-rev = "ccc4fbd8238c2d5ba354e61ec17ac610af11401d" ++rev = "3cf1c991e3660785d3855a34245949557db33209" + [patch.crates-io.tracing] + git = "https://github.com/girlbossceo/tracing" +-rev = "ccc4fbd8238c2d5ba354e61ec17ac610af11401d" ++rev = "3cf1c991e3660785d3855a34245949557db33209" + [patch.crates-io.tracing-core] + git = "https://github.com/girlbossceo/tracing" +-rev = "ccc4fbd8238c2d5ba354e61ec17ac610af11401d" ++rev = "3cf1c991e3660785d3855a34245949557db33209" + [patch.crates-io.tracing-log] + git = "https://github.com/girlbossceo/tracing" +-rev = "ccc4fbd8238c2d5ba354e61ec17ac610af11401d" ++rev = "3cf1c991e3660785d3855a34245949557db33209" + + # adds a tab completion callback: https://github.com/girlbossceo/rustyline-async/commit/de26100b0db03e419a3d8e1dd26895d170d1fe50 + # adds event for CTRL+\: https://github.com/girlbossceo/rustyline-async/commit/67d8c49aeac03a5ef4e818f663eaa94dd7bf339b diff --git a/overlay/default.nix b/overlay/default.nix new file mode 100644 index 0000000..4578a75 --- /dev/null +++ b/overlay/default.nix @@ -0,0 +1,7 @@ +let + overlays = [ + ./conduwuit + ]; + importedOverlays = map (m: import m) overlays; +in + importedOverlays