···228229 `acc`
230231- : The initial accumulator value
00000000232233 `list`
234···254 foldl' =
255 op:
256 acc:
257- list:
258-259 # The builtin `foldl'` is a bit lazier than one might expect.
260 # See https://github.com/NixOS/nix/pull/7158.
261 # In particular, the initial accumulator value is not forced before the first iteration starts.
262 builtins.seq acc
263- (builtins.foldl' op acc list);
264265 /**
266 Map with index starting from 0
···228229 `acc`
230231+ : The initial accumulator value.
232+233+ The accumulator value is evaluated in any case before the first iteration starts.
234+235+ To avoid evaluation even before the `list` argument is given an eta expansion can be used:
236+237+ ```nix
238+ list: lib.foldl' op acc list
239+ ```
240241 `list`
242···262 foldl' =
263 op:
264 acc:
00265 # The builtin `foldl'` is a bit lazier than one might expect.
266 # See https://github.com/NixOS/nix/pull/7158.
267 # In particular, the initial accumulator value is not forced before the first iteration starts.
268 builtins.seq acc
269+ (builtins.foldl' op acc);
270271 /**
272 Map with index starting from 0
···73 optional (attr ? ${name} && (! isMacAddress attr.${name} && attr.${name} != "none"))
74 "Systemd ${group} field `${name}` must be a valid MAC address or the special value `none`.";
7576-0000000077 isPort = i: i >= 0 && i <= 65535;
07879 assertPort = name: group: attr:
80 optional (attr ? ${name} && ! isPort attr.${name})
81 "Error on the systemd ${group} field `${name}': ${attr.name} is not a valid port number.";
00008283 assertValueOneOf = name: values: group: attr:
84 optional (attr ? ${name} && !elem attr.${name} values)
···73 optional (attr ? ${name} && (! isMacAddress attr.${name} && attr.${name} != "none"))
74 "Systemd ${group} field `${name}` must be a valid MAC address or the special value `none`.";
7576+ isNumberOrRangeOf = check: v:
77+ if isInt v
78+ then check v
79+ else let
80+ parts = splitString "-" v;
81+ lower = toIntBase10 (head parts);
82+ upper = if tail parts != [] then toIntBase10 (head (tail parts)) else lower;
83+ in
84+ length parts <= 2 && lower <= upper && check lower && check upper;
85 isPort = i: i >= 0 && i <= 65535;
86+ isPortOrPortRange = isNumberOrRangeOf isPort;
8788 assertPort = name: group: attr:
89 optional (attr ? ${name} && ! isPort attr.${name})
90 "Error on the systemd ${group} field `${name}': ${attr.name} is not a valid port number.";
91+92+ assertPortOrPortRange = name: group: attr:
93+ optional (attr ? ${name} && ! isPortOrPortRange attr.${name})
94+ "Error on the systemd ${group} field `${name}': ${attr.name} is not a valid port number or range of port numbers.";
9596 assertValueOneOf = name: values: group: attr:
97 optional (attr ? ${name} && !elem attr.${name} values)
+1
nixos/modules/services/networking/tinyproxy.nix
···7 mkValueStringTinyproxy = with lib; v:
8 if true == v then "yes"
9 else if false == v then "no"
010 else generators.mkValueStringDefault {} v;
11 mkKeyValueTinyproxy = {
12 mkValueString ? mkValueStringDefault {}
···7 mkValueStringTinyproxy = with lib; v:
8 if true == v then "yes"
9 else if false == v then "no"
10+ else if types.path.check v then ''"${v}"''
11 else generators.mkValueStringDefault {} v;
12 mkKeyValueTinyproxy = {
13 mkValueString ? mkValueStringDefault {}
···50 pytestCheckHook
51 ];
52000053 meta = with lib; {
54 description = "Generator of ANSI C tracers which output CTF data streams ";
55 homepage = "https://github.com/efficios/barectf";
···50 pytestCheckHook
51 ];
5253+ pytestFlagsArray = [
54+ "-W" "ignore::pytest.PytestRemovedIn8Warning"
55+ ];
56+57 meta = with lib; {
58 description = "Generator of ANSI C tracers which output CTF data streams ";
59 homepage = "https://github.com/efficios/barectf";
···52 pytestCheckHook
53 ];
54000055 disabledTests = [
56 # RuntimeError: a view of a leaf Variable that requires grad is being used in an in-place operation.
57 "test_adjoint"
···52 pytestCheckHook
53 ];
5455+ pytestFlagsArray = [
56+ "-W" "ignore::pytest.PytestRemovedIn8Warning"
57+ ];
58+59 disabledTests = [
60 # RuntimeError: a view of a leaf Variable that requires grad is being used in an in-place operation.
61 "test_adjoint"
···2223 patches = [
24 # Bump sha1cd package, otherwise i686-linux fails to build.
25- ./bump-sha1cd.patch
02627 # Seems to be an anti-feature. Startup is the only place where user/group is
28 # hardcoded and checked.
···5758 nativeBuildInputs = [ makeWrapper go-swag ];
5960- vendorHash = "sha256-402ND99FpU+zNV1e5Th1+aZKok49cIEdpPPLLfNyL3E=";
61 proxyVendor = true;
6263 # Generate code for Swagger documentation endpoints (see web/swagger/docs.go).
···2223 patches = [
24 # Bump sha1cd package, otherwise i686-linux fails to build.
25+ # Also bump github.com/swaggo/swag for PR 257790.
26+ ./deps.patch
2728 # Seems to be an anti-feature. Startup is the only place where user/group is
29 # hardcoded and checked.
···5859 nativeBuildInputs = [ makeWrapper go-swag ];
6061+ vendorHash = "sha256-itiWROoIhnMbG9evH6X7kjClC4VdpX983d/SCwr4HbY=";
62 proxyVendor = true;
6364 # Generate code for Swagger documentation endpoints (see web/swagger/docs.go).