infrastructure/machines/vault01/k-radius/packages/rlm_python.nix

48 lines
763 B
Nix
Raw Normal View History

{
stdenv,
fetchFromGitHub,
2024-04-08 22:42:59 +02:00
substituteAll,
python3,
pykanidm,
}:
let
2024-04-08 22:42:59 +02:00
pythonPath = python3.pkgs.makePythonPath [ pykanidm ];
in
2024-04-08 22:42:59 +02:00
stdenv.mkDerivation rec {
2023-12-03 17:35:07 +01:00
pname = "rlm_python";
2024-04-08 22:42:59 +02:00
version = "1.1.0-rc.16";
2023-12-03 17:35:07 +01:00
src = fetchFromGitHub {
owner = "kanidm";
repo = "kanidm";
rev = "v${version}";
2024-04-08 22:42:59 +02:00
hash = "sha256-NH9V5KKI9LAtJ2/WuWtUJUzkjVMfO7Q5NQkK7Ys2olU=";
2023-12-03 17:35:07 +01:00
};
2024-04-08 22:42:59 +02:00
sourceRoot = "source/rlm_python";
2023-12-03 17:35:07 +01:00
2024-04-08 22:42:59 +02:00
patches = [
(substituteAll {
src = ./01-python_path.patch;
inherit pythonPath;
})
];
2023-12-03 17:35:07 +01:00
installPhase = ''
mkdir -p $out/etc/raddb/
2024-04-08 22:42:59 +02:00
cp -R mods-available sites-available $out/etc/raddb/
2023-12-03 17:35:07 +01:00
'';
phases = [
"unpackPhase"
"patchPhase"
"installPhase"
];
2023-12-03 17:35:07 +01:00
passthru = {
inherit pythonPath;
};
2023-12-03 17:35:07 +01:00
}