push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,65 @@
{
newScope,
lib,
python3,
}:
let
self = lib.makeExtensible (
self:
let
inherit (self) callPackage;
in
{
callPackage = newScope self;
python3 = callPackage ./python.nix { inherit python3; };
hyperkitty = callPackage ./hyperkitty.nix { };
mailman = callPackage ./package.nix { };
mailman-hyperkitty = callPackage ./mailman-hyperkitty.nix { };
postorius = callPackage ./postorius.nix { };
web = callPackage ./web.nix { };
buildEnvs =
{
web ? self.web,
mailman ? self.mailman,
mailman-hyperkitty ? self.mailman-hyperkitty,
withHyperkitty ? false,
withLDAP ? false,
}:
{
mailmanEnv = self.python3.withPackages (
ps:
[
mailman
ps.psycopg2
]
++ lib.optional withHyperkitty mailman-hyperkitty
++ lib.optionals withLDAP [
ps.python-ldap
ps.django-auth-ldap
]
);
webEnv = self.python3.withPackages (
ps:
[
web
ps.psycopg2
]
++ lib.optionals withLDAP [
ps.python-ldap
ps.django-auth-ldap
]
);
};
}
);
in
self

View File

@@ -0,0 +1,88 @@
{
lib,
python3,
fetchurl,
nixosTests,
fetchpatch,
}:
with python3.pkgs;
buildPythonPackage rec {
pname = "hyperkitty";
version = "1.3.12";
pyproject = true;
disabled = pythonOlder "3.10";
src = fetchurl {
url = "https://gitlab.com/mailman/hyperkitty/-/releases/${version}/downloads/hyperkitty-${version}.tar.gz";
hash = "sha256-3rWCk37FvJ6pwdXYa/t2pNpCm2Dh/qb9aWTnxmfPFh0=";
};
patches = [
# Fix test with mistune >= 3.1
(fetchpatch {
url = "https://gitlab.com/mailman/hyperkitty/-/commit/2d69f420c603356a639a6b6243e1059a0089b7eb.patch";
hash = "sha256-zo+dK8DFMkHlMrOVSUtelhAq+cxJE4gLG00LvuAlWKA=";
})
# Fix test with python 3.13
# https://gitlab.com/mailman/hyperkitty/-/merge_requests/657
(fetchpatch {
url = "https://gitlab.com/mailman/hyperkitty/-/commit/6c3d402dc0981e545081a3baf13db7e491356e75.patch";
hash = "sha256-ep9cFZe9/sIfIP80pLBOMYkJKWvNT7DRqg80DQSdRFw=";
})
];
build-system = [
pdm-backend
];
dependencies = [
django
django-gravatar2
django-haystack
django-mailman3
django-q2
django-compressor
django-extensions
djangorestframework
flufl-lock
mistune
networkx
psycopg2
python-dateutil
robot-detection
];
# Some of these are optional runtime dependencies that are not
# listed as dependencies in pyproject.toml. To use these, they
# should be dependencies of the Django Python environment, but not
# of HyperKitty so they're not included for people who don't need
# them.
nativeCheckInputs = [
beautifulsoup4
elastic-transport
elasticsearch
mock
whoosh
]
++ beautifulsoup4.optional-dependencies.lxml;
checkPhase = ''
cd $NIX_BUILD_TOP/$sourceRoot
PYTHONPATH=.:$PYTHONPATH python example_project/manage.py test \
--settings=hyperkitty.tests.settings_test hyperkitty
'';
passthru.tests = { inherit (nixosTests) mailman; };
meta = {
changelog = "https://docs.mailman3.org/projects/hyperkitty/en/latest/news.html";
homepage = "https://www.gnu.org/software/mailman/";
description = "Archiver for GNU Mailman v3";
license = lib.licenses.gpl3;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ qyliss ];
};
}

View File

@@ -0,0 +1,13 @@
diff --git a/src/mailman/core/logging.py b/src/mailman/core/logging.py
index f8f87279f..7ff13b003 100644
--- a/src/mailman/core/logging.py
+++ b/src/mailman/core/logging.py
@@ -142,6 +142,8 @@ def _init_logger(propagate, sub_name, log, logger_config):
address, facility = _get_syslog_params(logger_config)
handler = logging.handlers.SysLogHandler(
address=address, facility=facility)
+ elif logger_config.handler == 'stderr':
+ handler = logging.StreamHandler(sys.stderr)
else:
path_str = logger_config.path
path_abs = os.path.normpath(os.path.join(config.LOG_DIR, path_str))

View File

@@ -0,0 +1,52 @@
{
lib,
python3,
fetchPypi,
mailman,
nixosTests,
}:
with python3.pkgs;
buildPythonPackage rec {
pname = "mailman-hyperkitty";
version = "1.2.1";
format = "setuptools";
disabled = pythonOlder "3.9";
src = fetchPypi {
inherit pname version;
hash = "sha256-+Nad+8bMtYKJbUCpppRXqhB1zdbvvFXTTHlwJLQLzDg=";
};
propagatedBuildInputs = [
mailman
requests
zope-interface
];
nativeCheckInputs = [
mock
nose2
];
checkPhase = ''
${python.interpreter} -m nose2 -v
'';
# There is an AssertionError
doCheck = false;
pythonImportsCheck = [
"mailman_hyperkitty"
];
passthru.tests = { inherit (nixosTests) mailman; };
meta = with lib; {
description = "Mailman archiver plugin for HyperKitty";
homepage = "https://gitlab.com/mailman/mailman-hyperkitty";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ qyliss ];
};
}

View File

@@ -0,0 +1,95 @@
{
lib,
fetchpatch,
python3,
fetchPypi,
postfix,
lynx,
nixosTests,
}:
with python3.pkgs;
buildPythonPackage rec {
pname = "mailman";
version = "3.3.9";
pyproject = true;
disabled = pythonOlder "3.6";
src = fetchPypi {
inherit pname version;
hash = "sha256-GblXI6IwkLl+V1gEbMAe1baVyZOHMaYaYITXcTkp2Mo=";
};
build-system = with python3.pkgs; [
setuptools
];
dependencies = with python3.pkgs; [
aiosmtpd
alembic
authheaders
click
dnspython
falcon
flufl-bounce
flufl-i18n
flufl-lock
gunicorn
lazr-config
passlib
python-dateutil
requests
sqlalchemy
standard-nntplib
zope-component
zope-configuration
];
checkInputs = [
sphinx
];
patches = [
(fetchpatch {
url = "https://gitlab.com/mailman/mailman/-/commit/4b206e2a5267a0e17f345fd7b2d957122ba57566.patch";
sha256 = "06axmrn74p81wvcki36c7gfj5fp5q15zxz2yl3lrvijic7hbs4n2";
})
(fetchpatch {
url = "https://gitlab.com/mailman/mailman/-/commit/9613154f3c04fa2383fbf017031ef263c291418d.patch";
sha256 = "0vyw87s857vfxbf7kihwb6w094xyxmxbi1bpdqi3ybjamjycp55r";
})
(fetchpatch {
name = "python-3.13.patch";
url = "https://gitlab.com/mailman/mailman/-/commit/685d9a7bdbd382d9e8d4a2da74bd973e93356e05.patch";
hash = "sha256-KCXVP+5zqgluUXQCGmMRC+G1hEDnFBlTUETGpmFDOOk=";
})
./log-stderr.patch
];
postPatch = ''
substituteInPlace src/mailman/config/postfix.cfg \
--replace /usr/sbin/postmap ${postfix}/bin/postmap
substituteInPlace src/mailman/config/schema.cfg \
--replace /usr/bin/lynx ${lynx}/bin/lynx
'';
# Mailman assumes that those scripts in $out/bin are Python scripts. Wrapping
# them in shell code breaks this assumption. Use the wrapped version (see
# wrapped.nix) if you need the CLI (rather than the Python library).
#
# This gives a properly wrapped 'mailman' command plus an interpreter that
# has all the necessary search paths to execute unwrapped 'master' and
# 'runner' scripts.
dontWrapPythonPrograms = true;
passthru.tests = { inherit (nixosTests) mailman; };
meta = {
homepage = "https://www.gnu.org/software/mailman/";
description = "Free software for managing electronic mail discussion and newsletter lists";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ qyliss ];
};
}

View File

@@ -0,0 +1,42 @@
{
lib,
python3,
fetchPypi,
nixosTests,
}:
with python3.pkgs;
buildPythonPackage rec {
pname = "postorius";
version = "1.3.10";
format = "setuptools";
src = fetchPypi {
inherit pname version;
hash = "sha256-GmbIqO+03LgbUxJ1nTStXrYN3t2MfvzbeYRAipfTW1o=";
};
propagatedBuildInputs = [
django-mailman3
readme-renderer
]
++ readme-renderer.optional-dependencies.md;
nativeCheckInputs = [
beautifulsoup4
vcrpy
mock
];
# Tries to connect to database.
doCheck = false;
passthru.tests = { inherit (nixosTests) mailman; };
meta = with lib; {
homepage = "https://docs.mailman3.org/projects/postorius";
description = "Web-based user interface for managing GNU Mailman";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ qyliss ];
};
}

View File

@@ -0,0 +1,46 @@
{
python3,
lib,
overlay ? (_: _: { }),
}:
lib.fix (
self:
python3.override {
inherit self;
packageOverrides =
lib.composeExtensions
(self: super: {
/*
This overlay can be used whenever we need to override
dependencies specific to the mailman ecosystem: in the past
this was necessary for e.g. psycopg2[1] or sqlalchemy[2].
In such a large ecosystem this sort of issue is expected
to arise again. Since we don't want to clutter the python package-set
itself with version overrides and don't want to change the APIs
in here back and forth every time this comes up (and as a result
force users to change their code accordingly), this overlay
is kept on purpose, even when empty.
[1] 72a14ea563a3f5bf85db659349a533fe75a8b0ce
[2] f931bc81d63f5cfda55ac73d754c87b3fd63b291
*/
django-allauth = super.django-allauth.overrideAttrs (
new:
{ src, ... }:
{
version = "0.63.6";
src = src.override {
tag = new.version;
hash = "sha256-13/QbA//wyHE9yMB7Jy/sJEyqPKxiMN+CZwSc4U6okU=";
};
patches = [ ];
}
);
})
overlay;
}
)

View File

@@ -0,0 +1,59 @@
{
lib,
python3,
fetchPypi,
sassc,
hyperkitty,
postorius,
nixosTests,
}:
with python3.pkgs;
buildPythonPackage rec {
pname = "mailman_web";
version = "0.0.9";
disabled = pythonOlder "3.8";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-3wnduej6xMQzrjGhGXQznfJud/Uoy3BDduukRJeahL8=";
};
postPatch = ''
# Upstream seems to mostly target installing on top of existing
# distributions, and uses a path appropriate for that, but we are
# a distribution, so use a state directory appropriate for a
# distro package.
substituteInPlace mailman_web/settings/base.py \
--replace-fail /opt/mailman/web /var/lib/mailman-web
'';
nativeBuildInputs = [ pdm-backend ];
propagatedBuildInputs = [
hyperkitty
postorius
whoosh
];
# Tries to check runtime configuration.
doCheck = false;
makeWrapperArgs = [
"--suffix PATH : ${lib.makeBinPath [ sassc ]}"
];
passthru.tests = { inherit (nixosTests) mailman; };
meta = with lib; {
homepage = "https://gitlab.com/mailman/mailman-web";
description = "Django project for Mailman 3 web interface";
mainProgram = "mailman-web";
license = licenses.gpl3Plus;
maintainers = with maintainers; [
qyliss
m1cr0man
];
};
}

View File

@@ -0,0 +1,58 @@
{
stdenv,
fetchurl,
lib,
tls ? true,
gnutls ? null,
}:
assert tls -> gnutls != null;
stdenv.mkDerivation rec {
version = "2.2";
pname = "nullmailer";
src = fetchurl {
url = "https://untroubled.org/nullmailer/nullmailer-${version}.tar.gz";
sha256 = "0md8cf90fl2yf3zh9njjy42a673v4j4ygyq95xg7fzkygdigm1lq";
};
buildInputs = lib.optional tls gnutls;
configureFlags = [
"--sysconfdir=/etc"
"--localstatedir=/var"
]
++ lib.optional tls "--enable-tls";
installFlags = [ "DESTDIR=$(out)" ];
# We have to remove the ''var'' directory, since nix can't handle named pipes
# and we can't use it in the store anyway. Same for ''etc''.
# The second line is need, because the installer of nullmailer will copy its
# own prepared version of ''etc'' and ''var'' and also uses the prefix path (configure phase)
# for hardcoded absolute references to its own binary farm, e.g. sendmail binary is
# calling nullmailer-inject binary. Since we can't configure inside the store of
# the derivation we need both directories in the root, but don't want to put them there
# during install, hence we have to fix mumbling inside the install directory.
# This is kind of a hack, but the only way I know of, yet.
postInstall = ''
rm -rf $out/var/ $out/etc/
mv $out/$out/* $out/
rmdir $out/$out
'';
enableParallelBuilding = true;
meta = {
homepage = "http://untroubled.org/nullmailer/";
description = ''
A sendmail/qmail/etc replacement MTA for hosts which relay to a fixed set of smart relays.
It is designed to be simple to configure, secure, and easily extendable.
'';
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ sargon ];
};
}

View File

@@ -0,0 +1,193 @@
{
stdenv,
lib,
fetchurl,
makeWrapper,
nixosTests,
buildPerlPackage,
coreutils,
curl,
git,
gnumake,
highlight,
libgit2,
libxcrypt,
man,
openssl,
pkg-config,
sqlite,
xapian,
AnyURIEscape,
DBDSQLite,
DBI,
EmailAddressXS,
EmailMIME,
IOSocketSSL,
# FIXME: to be packaged
#, IOSocketSocks
IPCRun,
Inline,
InlineC,
LinuxInotify2,
MailIMAPClient,
# FIXME: to be packaged
#, NetNetrc
# FIXME: to be packaged
#, NetNNTP
ParseRecDescent,
Plack,
PlackMiddlewareReverseProxy,
PlackTestExternalServer,
Xapian,
TestSimple13,
TimeDate,
URI,
XMLTreePP,
}:
let
skippedTests = [
# fatal: Could not make /tmp/pi-search-9188-DGZM/a.git/branches/ writable by group
"search"
# perl5.32.0-public-inbox> t/eml.t ...................... 1/? Cannot parse parameter '=?ISO-8859-1?Q?=20charset=3D=1BOF?=' at t/eml.t line 270.
# perl5.32.0-public-inbox> # Failed test 'got wide character by assuming utf-8'
# perl5.32.0-public-inbox> # at t/eml.t line 272.
# perl5.32.0-public-inbox> Wide character in print at /nix/store/38vxlxrvg3yji3jms44qn94lxdysbj5j-perl-5.32.0/lib/perl5/5.32.0/Test2/Formatter/TAP.pm line 125.
"eml"
# Failed test 'Makefile OK'
# at t/hl_mod.t line 19.
# got: 'makefile'
# expected: 'make'
"hl_mod"
# Hangs on "inbox unlocked on initial fetch, waiting for IDLE".
# Fixed in HEAD: 7234e671 ("t/imapd: workaround a Perl 5.36.0 readline regression")
"imapd"
# Failed test 'clone + index v1 synced ->created_at'
# at t/lei-mirror.t line 175.
# got: '1638378723'
# expected: undef
# Failed test 'clone + index v1 synced ->created_at'
# at t/lei-mirror.t line 178.
# got: '1638378723'
# expected: undef
# May be due to the use of $ENV{HOME}.
"lei-mirror"
# Failed test 'child error (pure-Perl)'
# at t/spawn.t line 33.
# got: '0'
# expected: anything else
# waiting for child to reap grandchild...
"spawn"
# Failed to connect to 127.0.0.1
"v2mirror"
];
testConditions = lib.concatMapStringsSep " " (n: "! -name ${lib.escapeShellArg n}.t") skippedTests;
in
buildPerlPackage rec {
pname = "public-inbox";
version = "1.9.0";
src = fetchurl {
url = "https://public-inbox.org/public-inbox.git/snapshot/public-inbox-${version}.tar.gz";
sha256 = "sha256-ENnT2YK7rpODII9TqiEYSCp5mpWOnxskeSuAf8Ilqro=";
};
outputs = [
"out"
"devdoc"
"sa_config"
];
postConfigure = ''
substituteInPlace Makefile --replace 'TEST_FILES = t/*.t' \
'TEST_FILES = $(shell find t -name *.t ${testConditions})'
substituteInPlace lib/PublicInbox/TestCommon.pm \
--replace /bin/cp ${coreutils}/bin/cp
'';
nativeBuildInputs = [ makeWrapper ];
buildInputs = [
AnyURIEscape
DBDSQLite
DBI
EmailAddressXS
highlight
IOSocketSSL
#IOSocketSocks
IPCRun
Inline
InlineC
MailIMAPClient
#NetNetrc
#NetNNTP
ParseRecDescent
Plack
PlackMiddlewareReverseProxy
Xapian
TimeDate
URI
libgit2 # For Gcf2
man
];
doCheck = !stdenv.hostPlatform.isDarwin;
nativeCheckInputs = [
curl
git
openssl
pkg-config
sqlite
xapian
EmailMIME
PlackTestExternalServer
TestSimple13
XMLTreePP
]
++ lib.optionals stdenv.hostPlatform.isLinux [
LinuxInotify2
];
preCheck = ''
perl certs/create-certs.perl
export TEST_LEI_ERR_LOUD=1
export HOME="$NIX_BUILD_TOP"/home
mkdir -p "$HOME"/.cache/public-inbox/inline-c
'';
installTargets = [ "install" ];
postInstall = ''
for prog in $out/bin/*; do
wrapProgram $prog \
--set NIX_CFLAGS_COMPILE_${stdenv.cc.suffixSalt} -I${lib.getDev libxcrypt}/include \
--prefix PATH : ${
lib.makeBinPath [
git
xapian
# for InlineC
gnumake
stdenv.cc
]
}
done
mv sa_config $sa_config
'';
passthru.tests = {
nixos-public-inbox = nixosTests.public-inbox;
};
meta = with lib; {
homepage = "https://public-inbox.org/";
license = licenses.agpl3Plus;
maintainers = with maintainers; [
julm
qyliss
];
platforms = platforms.all;
};
}

View File

@@ -0,0 +1,43 @@
{
lib,
buildPythonApplication,
fetchurl,
flit-core,
pyspf,
dnspython,
authres,
pymilter,
}:
buildPythonApplication rec {
pname = "spf-engine";
version = "3.1.0";
pyproject = true;
src = fetchurl {
url = "https://launchpad.net/${pname}/${lib.versions.majorMinor version}/${version}/+download/spf-engine-${version}.tar.gz";
hash = "sha256-HUuMxYFCqItLFgMSnrkwfmJWqgFGyI1RWgmljb+jkWk=";
};
nativeBuildInputs = [ flit-core ];
propagatedBuildInputs = [
pyspf
dnspython
authres
pymilter
];
pythonImportsCheck = [
"spf_engine"
"spf_engine.milter_spf"
"spf_engine.policyd_spf"
];
meta = {
homepage = "https://launchpad.net/spf-engine/";
description = "Postfix policy engine for Sender Policy Framework (SPF) checking";
maintainers = [ ];
license = lib.licenses.asl20;
};
}

View File

@@ -0,0 +1,47 @@
{
lib,
stdenv,
writeText,
runtimeShell,
}:
let
script = writeText "script" ''
#!${runtimeShell}
if command -v sendmail > /dev/null 2>&1 && [ "$(command -v sendmail)" != "{{MYPATH}}" ]; then
exec sendmail "$@"
elif [ -x /run/wrappers/bin/sendmail ]; then
exec /run/wrappers/bin/sendmail "$@"
elif [ -x /run/current-system/sw/bin/sendmail ]; then
exec /run/current-system/sw/bin/sendmail "$@"
else
echo "Unable to find system sendmail." >&2
exit 1
fi
'';
in
stdenv.mkDerivation {
pname = "system-sendmail";
version = "1.0";
src = script;
dontUnpack = true;
dontInstall = true;
buildPhase = ''
mkdir -p $out/bin
< $src sed "s#{{MYPATH}}#$out/bin/sendmail#" > $out/bin/sendmail
chmod +x $out/bin/sendmail
'';
meta = with lib; {
description = ''
A sendmail wrapper that calls the system sendmail. Do not install as system-wide sendmail!
'';
platforms = platforms.unix;
maintainers = with maintainers; [ ekleog ];
mainProgram = "sendmail";
};
}