Merge #222: Add nix-bitcoin.lib for utility functions and types
322ba5bfff
Add nix-bitcoin.lib for utility functions and types (Jonas Nick) Pull request description: ACKs for top commit: erikarvstedt: ACK322ba5bfff
Tree-SHA512: 61fc91d11c06883ffc15e200dfefd88b4169849c19d3073c76820910c641613e64d01439cc482792a5eaadabeca7711eb838f0f791fcfc70cfa79e2b156f4efc
This commit is contained in:
commit
b00e9b6aa3
@ -46,7 +46,7 @@ in {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
bind-addr = mkOption {
|
bind-addr = mkOption {
|
||||||
type = types.addCheck types.str (s: builtins.length (builtins.split ":" s) == 1);
|
type = pkgs.nix-bitcoin.lib.ipv4Address;
|
||||||
default = "127.0.0.1";
|
default = "127.0.0.1";
|
||||||
description = "Set an IP address or UNIX domain socket to listen to";
|
description = "Set an IP address or UNIX domain socket to listen to";
|
||||||
};
|
};
|
||||||
|
@ -47,7 +47,7 @@ in {
|
|||||||
description = "The data directory for LND.";
|
description = "The data directory for LND.";
|
||||||
};
|
};
|
||||||
listen = mkOption {
|
listen = mkOption {
|
||||||
type = types.addCheck types.str (s: builtins.length (builtins.split ":" s) == 1);
|
type = pkgs.nix-bitcoin.lib.ipv4Address;
|
||||||
default = "localhost";
|
default = "localhost";
|
||||||
description = "Bind to given address to listen to peer connections";
|
description = "Bind to given address to listen to peer connections";
|
||||||
};
|
};
|
||||||
|
@ -14,4 +14,6 @@
|
|||||||
lightning-loop = pkgs.callPackage ./lightning-loop { };
|
lightning-loop = pkgs.callPackage ./lightning-loop { };
|
||||||
|
|
||||||
pinned = import ./pinned.nix;
|
pinned = import ./pinned.nix;
|
||||||
|
|
||||||
|
lib = import ./lib.nix { inherit (pkgs) lib; };
|
||||||
}
|
}
|
||||||
|
5
pkgs/lib.nix
Normal file
5
pkgs/lib.nix
Normal 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);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user