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