155 lines
3.9 KiB
Nix
155 lines
3.9 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
mitel-ommclient2 = {
|
|
url = "git+https://git.clerie.de/clerie/mitel_ommclient2.git";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
outputs = { self, nixpkgs, mitel-ommclient2, ... }: let
|
|
fieldpoc_version = "0.11.0";
|
|
in {
|
|
packages.x86_64-linux = let
|
|
pkgs = import nixpkgs {
|
|
system = "x86_64-linux";
|
|
};
|
|
in {
|
|
fieldpoc = pkgs.python3Packages.buildPythonPackage {
|
|
pname = "fieldpoc";
|
|
version = fieldpoc_version;
|
|
|
|
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";
|
|
version = "0.12.2";
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
owner = "eventphone";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "sha256-VkL7MhK6Z0Y1Hnnoq0Ukyclk9gfc4u8qav6yNj+LCJg=";
|
|
};
|
|
|
|
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";
|
|
version = "0.4.1";
|
|
|
|
src = pkgs.python3Packages.fetchPypi {
|
|
inherit pname version;
|
|
sha256 = "sha256-rx0hcmP4SmvCkKXawyiMTKCVpTKTAgZVpbdQFdxV+hs=";
|
|
};
|
|
|
|
propagatedBuildInputs = [
|
|
pkgs.python3Packages.aiohttp
|
|
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" ];
|
|
};
|
|
|
|
yate = pkgs.yate.overrideAttrs (old: {
|
|
configureFlags = [ "--with-libpq=${pkgs.postgresql.withPackages (ps: [ ])}" ];
|
|
});
|
|
|
|
docs = pkgs.stdenv.mkDerivation {
|
|
pname = "fieldpoc-docs";
|
|
version = fieldpoc_version;
|
|
|
|
src = ./.;
|
|
|
|
buildInputs = [
|
|
pkgs.python3.pkgs.mkdocs-material
|
|
];
|
|
|
|
buildPhase = ''
|
|
python3 -m mkdocs build
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out
|
|
cp -r ./site/* $out/
|
|
'';
|
|
};
|
|
};
|
|
|
|
nixosModules = {
|
|
fieldpoc = { ... }: {
|
|
imports = [
|
|
./nix/modules/dhcp.nix
|
|
./nix/modules/fieldpoc.nix
|
|
./nix/modules/yate.nix
|
|
];
|
|
|
|
nixpkgs.overlays = [
|
|
(_: _: {
|
|
inherit (self.packages."x86_64-linux")
|
|
fieldpoc
|
|
yate;
|
|
})
|
|
];
|
|
};
|
|
default = self.nixosModules.fieldpoc;
|
|
};
|
|
|
|
hydraJobs = {
|
|
inherit (self)
|
|
packages;
|
|
};
|
|
};
|
|
}
|