From 5554ea55838f7b4fd3bf8f3efd7ef51180965eae Mon Sep 17 00:00:00 2001 From: Eric Litak Date: Tue, 29 Aug 2017 10:34:48 -0700 Subject: [PATCH] ipfs: preStart configuration moved into daemon services --- .../services/network-filesystems/ipfs.nix | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/nixos/modules/services/network-filesystems/ipfs.nix b/nixos/modules/services/network-filesystems/ipfs.nix index d6840b0ea0d4..34bb6770efd9 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 <