From ff7e1058b3bc6379b93a9ec72282a6ca92552ead Mon Sep 17 00:00:00 2001 From: magic_rb Date: Thu, 4 Jan 2024 08:04:34 +0100 Subject: [PATCH] Package ifstate Signed-off-by: magic_rb --- flake.nix | 4 ++- overlays/ifstate/default.nix | 7 ++++++ overlays/ifstate/ifstate.nix | 48 ++++++++++++++++++++++++++++++++++++ overlays/ifstate/wgnlpy.nix | 26 +++++++++++++++++++ 4 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 overlays/ifstate/default.nix create mode 100644 overlays/ifstate/ifstate.nix create mode 100644 overlays/ifstate/wgnlpy.nix diff --git a/flake.nix b/flake.nix index 5e9e9e0..fda8697 100644 --- a/flake.nix +++ b/flake.nix @@ -105,6 +105,7 @@ overlays/show-files-to-be-deleted overlays/rolling_datasets overlays/ledger-compat + overlays/ifstate inputs.uterranix.flakeModule ]; @@ -210,7 +211,8 @@ tree-sitter-grammars udp-over-tcp itp - rolling_datasets; + rolling_datasets + ifstate; # ds3os; }; diff --git a/overlays/ifstate/default.nix b/overlays/ifstate/default.nix new file mode 100644 index 0000000..b27bf5e --- /dev/null +++ b/overlays/ifstate/default.nix @@ -0,0 +1,7 @@ +{inputs, ...}: { + flake.overlays.ifstate = final: prev: { + ifstate = final.python3.pkgs.callPackage ./ifstate.nix { + wgnlpy = final.python3.pkgs.callPackage ./wgnlpy.nix {}; + }; + }; +} diff --git a/overlays/ifstate/ifstate.nix b/overlays/ifstate/ifstate.nix new file mode 100644 index 0000000..acdad7c --- /dev/null +++ b/overlays/ifstate/ifstate.nix @@ -0,0 +1,48 @@ +{ + lib, + fetchFromGitea, + buildPythonApplication, + jsonschema, + pyroute2, + pyyaml, + setproctitle, + libbpf, + withShell ? true, + pygments, + withWireguard ? true, + wgnlpy, +}: let + inherit + (lib) + optional + ; + version = "1.11.4"; +in + buildPythonApplication { + pname = "ifstate"; + inherit version; + + # preCheck = '' + # export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${libbpf}/lib + # ''; + + doCheck = false; + + propagatedBuildInputs = + [ + jsonschema + pyroute2 + pyyaml + setproctitle + ] + ++ (optional withShell pygments) + ++ (optional withWireguard wgnlpy); + + src = fetchFromGitea { + domain = "codeberg.org"; + owner = "liske"; + repo = "ifstate"; + rev = version; + hash = "sha256-7FgvLsY9cm6+mZ8nfADdECeLXUJFYCTLoUCUEYKjsA8="; + }; + } diff --git a/overlays/ifstate/wgnlpy.nix b/overlays/ifstate/wgnlpy.nix new file mode 100644 index 0000000..5e92bd0 --- /dev/null +++ b/overlays/ifstate/wgnlpy.nix @@ -0,0 +1,26 @@ +{ + fetchFromGitHub, + buildPythonPackage, + pyroute2, + cryptography, +}: let + version = "0.1.5"; +in + buildPythonPackage { + pname = "wgnpy"; + version = "v" + version; + + doCheck = false; + + propagatedBuildInputs = [ + pyroute2 + cryptography + ]; + + src = fetchFromGitHub { + owner = "ArgosyLabs"; + repo = "wgnlpy"; + rev = "2dc844a48651d6b62d03fd2916e829bf56929c18"; + hash = "sha256-5XAfBiKx4SqouA57PxmaCb0ea7mT2VeUI1tgnQE/ZwQ="; + }; + }