2024-02-02 10:51:31 +01:00
|
|
|
{
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
python3,
|
|
|
|
pykanidm,
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
pythonPath = with python3.pkgs; makePythonPath [ pykanidm ];
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2023-12-03 17:35:07 +01:00
|
|
|
pname = "rlm_python";
|
|
|
|
version = "1.1.0-rc.15";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kanidm";
|
|
|
|
repo = "kanidm";
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-0y8juXS61Z9zxOdsWAQ6lJurP+n855Nela6egYRecok=";
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = [ ./python_path.patch ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace rlm_python/mods-available/python3 \
|
|
|
|
--replace "@kanidm_python@" "${pythonPath}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/etc/raddb/
|
|
|
|
cp -R rlm_python/{mods-available,sites-available} $out/etc/raddb/
|
|
|
|
'';
|
|
|
|
|
2024-02-02 10:51:31 +01:00
|
|
|
phases = [
|
|
|
|
"unpackPhase"
|
|
|
|
"patchPhase"
|
|
|
|
"installPhase"
|
|
|
|
];
|
2023-12-03 17:35:07 +01:00
|
|
|
|
2024-02-02 10:51:31 +01:00
|
|
|
passthru = {
|
|
|
|
inherit pythonPath;
|
|
|
|
};
|
2023-12-03 17:35:07 +01:00
|
|
|
|
|
|
|
preferLocalBuild = true;
|
|
|
|
}
|