blob: 7a8dfbf09a13abb33070cc7fef17fb2822092305 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
lib: _: rec {
my = import ./my.nix lib;
dns = import ./dns.nix lib;
isEven = number:
assert (builtins.isInt number) || (builtins.isFloat number);
builtins.div number 2 == 0;
isOdd = !isEven;
pow = base: exponent:
assert (builtins.isInt base) && (builtins.isInt exponent);
assert exponent > 0;
builtins.foldl' (x: _: x * base) 1 (builtins.genList _ exponent);
comcat = lib.concatStringsSep ",";
mkTcpMem = min: ini: max: (lib.concatMapStrings (x: toString x + " ") [(pow 2 min) (pow 2 ini) (pow 2 max)]);
}
|