From ff480cb8b509db24ecfad6c8b7635a8914be9aaf Mon Sep 17 00:00:00 2001 From: clerie Date: Sun, 16 Oct 2022 10:43:13 +0200 Subject: [PATCH] Add flake --- flake.lock | 48 +++++++++++++++++++++++ flake.nix | 110 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 158 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..9b18302 --- /dev/null +++ b/flake.lock @@ -0,0 +1,48 @@ +{ + "nodes": { + "mitel-ommclient2": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1665864178, + "narHash": "sha256-dZ4YVEn4E29ubYqDSuNfVIuOnHEZ4sZGUuODdQsvtaU=", + "ref": "refs/heads/main", + "rev": "aef2761f9fba079f33f41337b443350cb314eeef", + "revCount": 67, + "type": "git", + "url": "https://git.clerie.de/clerie/mitel_ommclient2.git" + }, + "original": { + "type": "git", + "url": "https://git.clerie.de/clerie/mitel_ommclient2.git" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1665732960, + "narHash": "sha256-WBZ+uSHKFyjvd0w4inbm0cNExYTn8lpYFcHEes8tmec=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4428e23312933a196724da2df7ab78eb5e67a88e", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "mitel-ommclient2": "mitel-ommclient2", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..da94c3a --- /dev/null +++ b/flake.nix @@ -0,0 +1,110 @@ +{ + 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, ... }: { + packages.x86_64-linux = let + pkgs = import nixpkgs { + system = "x86_64-linux"; + }; + in { + fieldpoc = pkgs.python3Packages.buildPythonPackage { + pname = "fieldpoc"; + version = "0.11.0"; + + 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.11.0"; + + src = pkgs.fetchFromGitHub { + owner = "eventphone"; + repo = pname; + rev = "905a5bdee7a779eef83bc96d9c9a5b7a2212d5f0"; + sha256 = "sha256-UNpr1OCmb7U6TisgVcnZVSbhdgQ3AREX/XNXru+UsF4="; + }; + + 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.3.1"; + + src = pkgs.python3Packages.fetchPypi { + inherit pname version; + sha256 = "5e806802dc47a35c855b60cd459a2c98fb0109c7fc099f3e9f83a1a38abf9f90"; + }; + + propagatedBuildInputs = [ + 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" ]; + }; + + + }; + + hydraJobs = { + inherit (self) + packages; + }; + }; +}