Merge pull request #280940 from e1mo/fix-parsedmarc-smtp-to

Sandro 4a2f53b6 33489534

Changed files
+56 -14
nixos
modules
services
monitoring
pkgs
by-name
pa
parsedmarc
development
python-modules
parsedmarc
top-level
+4 -4
nixos/modules/services/monitoring/parsedmarc.nix
···
description = ''
The addresses to send outgoing mail to.
'';
-
apply = x: if x == [] then null else lib.concatStringsSep "," x;
+
apply = x: if x == [] || x == null then null else lib.concatStringsSep "," x;
};
};
···
];
dashboards.settings.providers = lib.mkIf cfg.provision.grafana.dashboard [{
name = "parsedmarc";
-
options.path = "${pkgs.python3Packages.parsedmarc.dashboard}";
+
options.path = "${pkgs.parsedmarc.dashboard}";
}];
};
};
···
services.parsedmarc.settings = lib.mkMerge [
(lib.mkIf cfg.provision.elasticsearch {
elasticsearch = {
-
hosts = [ "localhost:9200" ];
+
hosts = [ "http://localhost:9200" ];
ssl = false;
};
})
···
MemoryDenyWriteExecute = true;
LockPersonality = true;
SystemCallArchitectures = "native";
-
ExecStart = "${pkgs.python3Packages.parsedmarc}/bin/parsedmarc -c /run/parsedmarc/parsedmarc.ini";
+
ExecStart = "${lib.getExe pkgs.parsedmarc} -c /run/parsedmarc/parsedmarc.ini";
};
};
+41
pkgs/by-name/pa/parsedmarc/package.nix
···
+
{ lib
+
, python3
+
, fetchFromGitHub
+
}:
+
+
let
+
python = python3.override {
+
packageOverrides = self: super: {
+
# https://github.com/domainaware/parsedmarc/issues/464
+
msgraph-core = super.msgraph-core.overridePythonAttrs (old: rec {
+
version = "0.2.2";
+
+
src = fetchFromGitHub {
+
owner = "microsoftgraph";
+
repo = "msgraph-sdk-python-core";
+
rev = "v${version}";
+
hash = "sha256-eRRlG3GJX3WeKTNJVWgNTTHY56qiUGOlxtvEZ2xObLA=";
+
};
+
+
nativeBuildInputs = with self; [
+
flit-core
+
];
+
+
propagatedBuildInputs = with self; [
+
requests
+
];
+
+
nativeCheckInputs = with self; [
+
pytestCheckHook
+
responses
+
];
+
+
disabledTestPaths = [
+
"tests/integration"
+
];
+
+
pythonImportsCheck = [ "msgraph.core" ];
+
});
+
};
+
};
+
in with python.pkgs; toPythonApplication parsedmarc
+11 -8
pkgs/development/python-modules/parsedmarc/default.nix
···
, mailsuite
, msgraph-core
, nixosTests
+
, opensearch-py
, publicsuffixlist
, pythonOlder
+
, pythonRelaxDepsHook
, requests
, tqdm
-
, urllib3
, xmltodict
}:
···
hash = "sha256-tK/cxOw50awcDAGRDTQ+Nxb9aJl2+zLZHuJq88xNmXM=";
};
-
postPatch = ''
-
substituteInPlace pyproject.toml \
-
--replace "elasticsearch<7.14.0" "elasticsearch" \
-
--replace "elasticsearch-dsl==7.4.0" "elasticsearch-dsl"
-
'';
-
nativeBuildInputs = [
hatchling
+
pythonRelaxDepsHook
+
];
+
+
pythonRelaxDeps = [
+
"elasticsearch"
+
"elasticsearch-dsl"
];
propagatedBuildInputs = [
···
publicsuffixlist
requests
tqdm
-
urllib3
xmltodict
+
opensearch-py
];
# no tests on PyPI, no tags on GitHub
···
license = licenses.asl20;
maintainers = with maintainers; [ talyz ];
mainProgram = "parsedmarc";
+
# https://github.com/domainaware/parsedmarc/issues/464
+
broken = lib.versionAtLeast msgraph-core.version "1.0.0";
};
}
-2
pkgs/top-level/all-packages.nix
···
OSCAR = qt5.callPackage ../applications/misc/OSCAR { };
-
parsedmarc = with python3Packages; toPythonApplication parsedmarc;
-
pgmanage = callPackage ../applications/misc/pgmanage { };
pgadmin4 = callPackage ../tools/admin/pgadmin { };