···228228229229 `acc`
230230231231- : The initial accumulator value
231231+ : The initial accumulator value.
232232+233233+ The accumulator value is evaluated in any case before the first iteration starts.
234234+235235+ To avoid evaluation even before the `list` argument is given an eta expansion can be used:
236236+237237+ ```nix
238238+ list: lib.foldl' op acc list
239239+ ```
232240233241 `list`
234242···254262 foldl' =
255263 op:
256264 acc:
257257- list:
258258-259265 # The builtin `foldl'` is a bit lazier than one might expect.
260266 # See https://github.com/NixOS/nix/pull/7158.
261267 # In particular, the initial accumulator value is not forced before the first iteration starts.
262268 builtins.seq acc
263263- (builtins.foldl' op acc list);
269269+ (builtins.foldl' op acc);
264270265271 /**
266272 Map with index starting from 0
···7373 optional (attr ? ${name} && (! isMacAddress attr.${name} && attr.${name} != "none"))
7474 "Systemd ${group} field `${name}` must be a valid MAC address or the special value `none`.";
75757676-7676+ isNumberOrRangeOf = check: v:
7777+ if isInt v
7878+ then check v
7979+ else let
8080+ parts = splitString "-" v;
8181+ lower = toIntBase10 (head parts);
8282+ upper = if tail parts != [] then toIntBase10 (head (tail parts)) else lower;
8383+ in
8484+ length parts <= 2 && lower <= upper && check lower && check upper;
7785 isPort = i: i >= 0 && i <= 65535;
8686+ isPortOrPortRange = isNumberOrRangeOf isPort;
78877988 assertPort = name: group: attr:
8089 optional (attr ? ${name} && ! isPort attr.${name})
8190 "Error on the systemd ${group} field `${name}': ${attr.name} is not a valid port number.";
9191+9292+ assertPortOrPortRange = name: group: attr:
9393+ optional (attr ? ${name} && ! isPortOrPortRange attr.${name})
9494+ "Error on the systemd ${group} field `${name}': ${attr.name} is not a valid port number or range of port numbers.";
82958396 assertValueOneOf = name: values: group: attr:
8497 optional (attr ? ${name} && !elem attr.${name} values)
+1
nixos/modules/services/networking/tinyproxy.nix
···77 mkValueStringTinyproxy = with lib; v:
88 if true == v then "yes"
99 else if false == v then "no"
1010+ else if types.path.check v then ''"${v}"''
1011 else generators.mkValueStringDefault {} v;
1112 mkKeyValueTinyproxy = {
1213 mkValueString ? mkValueStringDefault {}
···5252 pytestCheckHook
5353 ];
54545555+ pytestFlagsArray = [
5656+ "-W" "ignore::pytest.PytestRemovedIn8Warning"
5757+ ];
5858+5559 disabledTests = [
5660 # RuntimeError: a view of a leaf Variable that requires grad is being used in an in-place operation.
5761 "test_adjoint"
···22222323 patches = [
2424 # Bump sha1cd package, otherwise i686-linux fails to build.
2525- ./bump-sha1cd.patch
2525+ # Also bump github.com/swaggo/swag for PR 257790.
2626+ ./deps.patch
26272728 # Seems to be an anti-feature. Startup is the only place where user/group is
2829 # hardcoded and checked.
···57585859 nativeBuildInputs = [ makeWrapper go-swag ];
59606060- vendorHash = "sha256-402ND99FpU+zNV1e5Th1+aZKok49cIEdpPPLLfNyL3E=";
6161+ vendorHash = "sha256-itiWROoIhnMbG9evH6X7kjClC4VdpX983d/SCwr4HbY=";
6162 proxyVendor = true;
62636364 # Generate code for Swagger documentation endpoints (see web/swagger/docs.go).