From 17066b5842163ed3703f415d6e5f7ad7a9f25369 Mon Sep 17 00:00:00 2001 From: Sergei Poljanski Date: Mon, 29 Jun 2026 05:12:24 +0300 Subject: [PATCH] litecoin: vendored Litecoin Core 0.21.5.5 (MWEB) --- .gitignore | 3 ++- configuration.nix | 1 + modules/litecoin-pkg.nix | 57 ++++++++++++++++++++++++++++++++++++++++ modules/litecoin.nix | 14 ++++++++++ 4 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 modules/litecoin-pkg.nix create mode 100644 modules/litecoin.nix diff --git a/.gitignore b/.gitignore index 2dd0052..b56b238 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ modules/usb-devices.nix secrets/ -.sops.yaml \ No newline at end of file +.sops.yaml +result \ No newline at end of file diff --git a/configuration.nix b/configuration.nix index d37bf23..1f7698b 100644 --- a/configuration.nix +++ b/configuration.nix @@ -19,6 +19,7 @@ ./modules/xray.nix ./modules/ollama.nix ./modules/gaming.nix + ./modules/litecoin.nix # ./modules/hostel-wifi.nix # disabled 2026-05-08 — re-enable when needed ]; diff --git a/modules/litecoin-pkg.nix b/modules/litecoin-pkg.nix new file mode 100644 index 0000000..90f8ead --- /dev/null +++ b/modules/litecoin-pkg.nix @@ -0,0 +1,57 @@ +{ lib, stdenv, mkDerivation, fetchFromGitHub +, pkg-config, autoreconfHook +, openssl, db48, boost, zlib +, glib, protobuf, util-linux, qrencode, sqlite +, withGui ? true, libevent +, qtbase, qttools +, zeromq +, fmt +}: + +# Litecoin Core 0.21.5.5 (MWEB). Revives the package dropped from nixpkgs in +# 2024-11 (commit 0367571). Build system is autotools (unlike modern Bitcoin +# Core, which moved to CMake). Still links OpenSSL — built against openssl_3 +# here (passed in by litecoin.nix), not the insecure 1.1 the old pin used. +mkDerivation rec { + pname = "litecoin" + lib.optionalString (!withGui) "d"; + version = "0.21.5.5"; + + src = fetchFromGitHub { + owner = "litecoin-project"; + repo = "litecoin"; + rev = "v${version}"; + hash = "sha256-lGWZ8SVa4depLXr/TJvk2G/sAbK/bVvHAnaN83XfIbA="; + }; + + patches = [ ]; + + nativeBuildInputs = [ pkg-config autoreconfHook ]; + + buildInputs = [ openssl db48 boost zlib zeromq fmt + glib protobuf util-linux libevent sqlite ] + ++ lib.optionals withGui [ qtbase qttools qrencode ]; + + # UPnP disabled: 0.21.5.5 predates the miniupnpc 2.2.8 API change + # (UPNP_GetValidIGD signature); auto-opening firewall ports is unwanted + # exposure anyway. Drops the miniupnpc dependency entirely. + configureFlags = [ + "--with-boost-libdir=${boost.out}/lib" + "--with-sqlite=yes" + "--without-miniupnpc" + ] ++ lib.optionals withGui [ + "--with-gui=qt5" + "--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin" + ]; + + enableParallelBuilding = true; + doCheck = false; + + meta = with lib; { + description = "Peer-to-peer cryptocurrency (Litecoin Core ${version}, with MWEB)"; + homepage = "https://litecoin.org/"; + license = licenses.mit; + platforms = platforms.linux; + mainProgram = if withGui then "litecoin-qt" else "litecoind"; + maintainers = with maintainers; [ ]; + }; +} diff --git a/modules/litecoin.nix b/modules/litecoin.nix new file mode 100644 index 0000000..1113876 --- /dev/null +++ b/modules/litecoin.nix @@ -0,0 +1,14 @@ +# Litecoin Core 0.21.5.5 (MWEB) — vendored build, revives the package dropped +# from nixpkgs. Builds against openssl_3 + boost181 (older Boost's autotools +# ax_boost macros are needed; Boost 1.89 fails the Boost::System link probe). +{ config, pkgs, lib, ... }: + +let + litecoin = pkgs.libsForQt5.callPackage ./litecoin-pkg.nix { + openssl = pkgs.openssl_3; + boost = pkgs.boost181; + }; +in +{ + environment.systemPackages = [ litecoin ]; +}