Merge pull request #158348 from schnusch/ipfs
nixos/ipfs: use ipfs config replace
This commit is contained in:
commit
c2038731e4
@ -260,24 +260,17 @@ in
|
|||||||
ipfs --offline config Mounts.IPNS ${cfg.ipnsMountDir}
|
ipfs --offline config Mounts.IPNS ${cfg.ipnsMountDir}
|
||||||
'' + optionalString cfg.autoMigrate ''
|
'' + optionalString cfg.autoMigrate ''
|
||||||
${pkgs.ipfs-migrator}/bin/fs-repo-migrations -y
|
${pkgs.ipfs-migrator}/bin/fs-repo-migrations -y
|
||||||
'' + concatStringsSep "\n" (collect
|
'' + ''
|
||||||
isString
|
ipfs --offline config show \
|
||||||
(mapAttrsRecursive
|
| ${pkgs.jq}/bin/jq '. * $extraConfig' --argjson extraConfig ${
|
||||||
(path: value:
|
escapeShellArg (builtins.toJSON ({
|
||||||
# Using heredoc below so that the value is never improperly quoted
|
Addresses.API = cfg.apiAddress;
|
||||||
''
|
Addresses.Gateway = cfg.gatewayAddress;
|
||||||
read value <<EOF
|
Addresses.Swarm = cfg.swarmAddress;
|
||||||
${builtins.toJSON value}
|
} // cfg.extraConfig))
|
||||||
EOF
|
} \
|
||||||
ipfs --offline config --json "${concatStringsSep "." path}" "$value"
|
| ipfs --offline config replace -
|
||||||
'')
|
'';
|
||||||
({
|
|
||||||
Addresses.API = cfg.apiAddress;
|
|
||||||
Addresses.Gateway = cfg.gatewayAddress;
|
|
||||||
Addresses.Swarm = cfg.swarmAddress;
|
|
||||||
} //
|
|
||||||
cfg.extraConfig))
|
|
||||||
);
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = [ "" "${cfg.package}/bin/ipfs daemon ${ipfsFlags}" ];
|
ExecStart = [ "" "${cfg.package}/bin/ipfs daemon ${ipfsFlags}" ];
|
||||||
User = cfg.user;
|
User = cfg.user;
|
||||||
|
Loading…
Reference in New Issue
Block a user