2022-10-16 10:43:13 +02:00
|
|
|
{
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
mitel-ommclient2 = {
|
|
|
|
url = "git+https://git.clerie.de/clerie/mitel_ommclient2.git";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
};
|
2023-10-14 21:26:27 +02:00
|
|
|
outputs = { self, nixpkgs, mitel-ommclient2, ... }: let
|
|
|
|
fieldpoc_version = "0.11.0";
|
|
|
|
in {
|
2022-10-16 10:43:13 +02:00
|
|
|
packages.x86_64-linux = let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
fieldpoc = pkgs.python3Packages.buildPythonPackage {
|
|
|
|
pname = "fieldpoc";
|
2023-10-14 21:26:27 +02:00
|
|
|
version = fieldpoc_version;
|
2022-10-16 10:43:13 +02:00
|
|
|
|
|
|
|
src = ./.;
|
|
|
|
|
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
buildInputs = [ pkgs.python3Packages.hatchling ];
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
mitel-ommclient2.packages.x86_64-linux.mitel-ommclient2
|
|
|
|
pkgs.python3Packages.sqlalchemy
|
|
|
|
self.packages.x86_64-linux.ywsd
|
|
|
|
self.packages.x86_64-linux.diffsync
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
ywsd = pkgs.python3Packages.buildPythonApplication rec {
|
|
|
|
pname = "ywsd";
|
2023-06-17 20:51:05 +02:00
|
|
|
version = "0.12.2";
|
2022-10-16 10:43:13 +02:00
|
|
|
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
owner = "eventphone";
|
|
|
|
repo = pname;
|
2023-06-17 20:51:05 +02:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-VkL7MhK6Z0Y1Hnnoq0Ukyclk9gfc4u8qav6yNj+LCJg=";
|
2022-10-16 10:43:13 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
pkgs.python3Packages.aiopg
|
|
|
|
pkgs.python3Packages.aiohttp
|
|
|
|
self.packages.x86_64-linux.python-yate
|
|
|
|
pkgs.python3Packages.pyyaml
|
|
|
|
pkgs.python3Packages.sqlalchemy
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
python-yate = pkgs.python3Packages.buildPythonPackage rec {
|
|
|
|
pname = "python-yate";
|
2023-06-17 20:51:05 +02:00
|
|
|
version = "0.4.1";
|
2022-10-16 10:43:13 +02:00
|
|
|
|
|
|
|
src = pkgs.python3Packages.fetchPypi {
|
|
|
|
inherit pname version;
|
2023-06-17 20:51:05 +02:00
|
|
|
sha256 = "sha256-rx0hcmP4SmvCkKXawyiMTKCVpTKTAgZVpbdQFdxV+hs=";
|
2022-10-16 10:43:13 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2023-06-17 20:51:05 +02:00
|
|
|
pkgs.python3Packages.aiohttp
|
2022-10-16 10:43:13 +02:00
|
|
|
pkgs.python3Packages.async-timeout
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "yate" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
diffsync = pkgs.python3Packages.buildPythonPackage rec {
|
|
|
|
pname = "diffsync";
|
|
|
|
version = "1.5.1";
|
|
|
|
|
|
|
|
src = pkgs.python3Packages.fetchPypi {
|
|
|
|
inherit pname version;
|
|
|
|
sha256 = "84a736d03d385bd07cf7c86f57385d4130c3c3273bf7bc90febe2fa530ee1aa6";
|
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
pkgs.python3Packages.pydantic
|
|
|
|
(pkgs.python3Packages.override {
|
|
|
|
overrides = (self: super: {
|
|
|
|
structlog = super.structlog.overrideAttrs (old: rec {
|
|
|
|
version = "21.5.0";
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
owner = "hynek";
|
|
|
|
repo = "structlog";
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
sha256 = "0bc5lj0732j0hjq89llgrncyzs6k3aaffvg07kr3la44w0hlrb4l";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}).structlog
|
|
|
|
pkgs.python3Packages.colorama
|
|
|
|
pkgs.python3Packages.redis
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "diffsync" ];
|
|
|
|
};
|
|
|
|
|
2023-06-18 21:51:21 +02:00
|
|
|
yate = pkgs.yate.overrideAttrs (old: {
|
|
|
|
configureFlags = [ "--with-libpq=${pkgs.postgresql.withPackages (ps: [ ])}" ];
|
|
|
|
});
|
2023-09-15 18:00:18 +02:00
|
|
|
|
|
|
|
docs = pkgs.stdenv.mkDerivation {
|
|
|
|
pname = "fieldpoc-docs";
|
2023-10-14 21:26:27 +02:00
|
|
|
version = fieldpoc_version;
|
2023-09-15 18:00:18 +02:00
|
|
|
|
|
|
|
src = ./.;
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
pkgs.python3.pkgs.mkdocs-material
|
|
|
|
];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
python3 -m mkdocs build
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -r ./site/* $out/
|
|
|
|
'';
|
|
|
|
};
|
2023-06-18 21:51:21 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nixosModules = {
|
|
|
|
fieldpoc = { ... }: {
|
|
|
|
imports = [
|
|
|
|
./nix/modules/dhcp.nix
|
|
|
|
./nix/modules/fieldpoc.nix
|
|
|
|
./nix/modules/yate.nix
|
|
|
|
];
|
2022-10-16 10:43:13 +02:00
|
|
|
|
2023-06-18 21:51:21 +02:00
|
|
|
nixpkgs.overlays = [
|
|
|
|
(_: _: {
|
|
|
|
inherit (self.packages."x86_64-linux")
|
|
|
|
fieldpoc
|
|
|
|
yate;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
};
|
|
|
|
default = self.nixosModules.fieldpoc;
|
2022-10-16 10:43:13 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
hydraJobs = {
|
|
|
|
inherit (self)
|
|
|
|
packages;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|