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:
parent
a98778998c
commit
38f1576ba9
|
@ -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 -
|
||||
'';
|
||||
|
|
Loading…
Reference in a new issue