Add nix-bitcoin.lib for utility functions and types

This commit is contained in:
Jonas Nick 2020-08-04 14:11:51 +00:00
parent 72000b4a99
commit 322ba5bfff
No known key found for this signature in database
GPG key ID: 4861DBF262123605
4 changed files with 9 additions and 2 deletions

View file

@ -14,4 +14,6 @@
lightning-loop = pkgs.callPackage ./lightning-loop { };
pinned = import ./pinned.nix;
lib = import ./lib.nix { inherit (pkgs) lib; };
}

5
pkgs/lib.nix Normal file
View file

@ -0,0 +1,5 @@
{ lib }:
{
# An address type that checks that there's no port
ipv4Address = lib.types.addCheck lib.types.str (s: builtins.length (builtins.split ":" s) == 1);
}