@@ -216,14 +216,11 @@ in {
216216
217217 systemd.packages = [ cfg.package ];
218218
219− systemd.services.ipfs-init = {
220− description = "IPFS Initializer";
221−
219+ systemd.services.ipfs = {
220+ path = [ "/run/wrappers" cfg.package ];
222221 environment.IPFS_PATH = cfg.dataDir;
223222
224− path = [ cfg.package ];
225−
226− script = ''
223+ preStart = ''
227224 if [[ ! -f ${cfg.dataDir}/config ]]; then
228225 ipfs init ${optionalString cfg.emptyRepo "-e"} \
229226 ${optionalString (! cfg.localDiscovery) "--profile=server"}
@@ -233,26 +230,7 @@ in {
233230 else "ipfs config profile apply server"
234231 }
235232 fi
236− '';
237−
238− wantedBy = [ "default.target" ];
239−
240− serviceConfig = {
241− Type = "oneshot";
242− RemainAfterExit = true;
243− User = cfg.user;
244− Group = cfg.group;
245− };
246− };
247−
248− systemd.services.ipfs = {
249− path = [ "/run/wrappers" cfg.package ];
250− environment.IPFS_PATH = cfg.dataDir;
251−
252− wants = [ "ipfs-init.service" ];
253− after = [ "ipfs-init.service" ];
254−
255− preStart = optionalString cfg.autoMount ''
233+ '' + optionalString cfg.autoMount ''
256234 ipfs --local config Mounts.FuseAllowOther --json true
257235 ipfs --local config Mounts.IPFS ${cfg.ipfsMountDir}
258236 ipfs --local config Mounts.IPNS ${cfg.ipnsMountDir}