diff --git a/nixos/modules/services/network-filesystems/ipfs.nix b/nixos/modules/services/network-filesystems/ipfs.nix index d6840b0ea0d..34bb6770efd 100644 --- a/nixos/modules/services/network-filesystems/ipfs.nix +++ b/nixos/modules/services/network-filesystems/ipfs.nix @@ -36,6 +36,26 @@ let baseService = recursiveUpdate commonEnv { wants = [ "ipfs-init.service" ]; + preStart = '' + ipfs --local config Addresses.API ${cfg.apiAddress} + ipfs --local config Addresses.Gateway ${cfg.gatewayAddress} + '' + optionalString cfg.autoMount '' + ipfs --local config Mounts.FuseAllowOther --json true + mkdir -p $(ipfs --local config Mounts.IPFS) + mkdir -p $(ipfs --local config Mounts.IPNS) + '' + concatStringsSep "\n" (collect + isString + (mapAttrsRecursive + (path: value: + # Using heredoc below so that the value is never improperly quoted + '' + read value <