3
0
Fork 0
forked from mirrors/nixpkgs

nixos/ipfs: use lib.recursiveUpdate instead of // operator

Use `recursiveUpdate` instead of the // operator, as recommended in https://nix.dev/anti-patterns/language#attr1-attr2-merge-operator. Without this change, setting `services.ipfs.extraConfig.Addresses.NoAnnounce` for example will cause `services.ipfs.apiAddress`, `services.ipfs.gatewayAddress` and `services.ipfs.swarmAddress` to be ignored.
This commit is contained in:
Luflosi 2022-03-22 12:03:46 +01:00
parent a98778998c
commit 38f1576ba9
No known key found for this signature in database
GPG key ID: 4E41E29EDCC345D0

View file

@ -263,11 +263,15 @@ in
'' + ''
ipfs --offline config show \
| ${pkgs.jq}/bin/jq '. * $extraConfig' --argjson extraConfig ${
escapeShellArg (builtins.toJSON ({
Addresses.API = cfg.apiAddress;
Addresses.Gateway = cfg.gatewayAddress;
Addresses.Swarm = cfg.swarmAddress;
} // cfg.extraConfig))
escapeShellArg (builtins.toJSON (
recursiveUpdate
{
Addresses.API = cfg.apiAddress;
Addresses.Gateway = cfg.gatewayAddress;
Addresses.Swarm = cfg.swarmAddress;
}
cfg.extraConfig
))
} \
| ipfs --offline config replace -
'';