about summary refs log tree commit diff
path: root/users/Profpatsch/netencode/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'users/Profpatsch/netencode/default.nix')
-rw-r--r--users/Profpatsch/netencode/default.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/users/Profpatsch/netencode/default.nix b/users/Profpatsch/netencode/default.nix
new file mode 100644
index 000000000000..4a06cd700e94
--- /dev/null
+++ b/users/Profpatsch/netencode/default.nix
@@ -0,0 +1,48 @@
+{ pkgs, depot, ... }:
+
+let
+  imports = {
+    inherit (depot.users.Profpatsch)
+      writers;
+  };
+
+  version-check = pkgs.buildRustCrate {
+    pname = "version-check";
+    version = "0.9.2";
+    crateName = "version-check";
+    sha256 = "1vwvc1mzwv8ana9jv8z933p2xzgj1533qwwl5zr8mi89azyhq21v";
+  };
+  memchr = pkgs.buildRustCrate {
+    pname = "memchr";
+    version = "2.3.3";
+    crateName = "memchr";
+    sha256 = "1ivxvlswglk6wd46gadkbbsknr94gwryk6y21v64ja7x4icrpihw";
+  };
+  nom = pkgs.buildRustCrate {
+    pname = "nom";
+    version = "5.1.1";
+    crateName = "nom";
+    sha256 = "1gb4r6mjwd645jqh02nhn60i7qkw8cgy3xq1r4clnmvz3cmkv1l0";
+    dependencies = [ memchr ];
+    buildDependencies = [ version-check ];
+    features = [ "std" "alloc" ];
+  };
+
+  netencode-rs-common = tests: imports.writers.rustSimpleLib {
+    name = "netencode";
+    dependencies = [ nom ];
+    buildTests = tests;
+    release = false;
+    verbose = true;
+  } (builtins.readFile ./netencode.rs);
+
+  netencode-rs-tests = netencode-rs-common true;
+
+  netencode-rs = netencode-rs-common false;
+
+in {
+  inherit
+   netencode-rs
+   netencode-rs-tests
+   ;
+}