summary refs log tree commit diff
path: root/nixos/modules/services/network-filesystems
diff options
context:
space:
mode:
authorEric Litak <elitak@gmail.com>2017-08-30 08:24:09 -0700
committerEric Litak <elitak@gmail.com>2017-08-30 08:24:38 -0700
commit5050c5638235ee2af92dfc769ea0476bc049e62d (patch)
treef5b5354d8a3d16b6b8dda32d80c7776111749caf /nixos/modules/services/network-filesystems
parent5554ea55838f7b4fd3bf8f3efd7ef51180965eae (diff)
downloadnixlib-5050c5638235ee2af92dfc769ea0476bc049e62d.tar
nixlib-5050c5638235ee2af92dfc769ea0476bc049e62d.tar.gz
nixlib-5050c5638235ee2af92dfc769ea0476bc049e62d.tar.bz2
nixlib-5050c5638235ee2af92dfc769ea0476bc049e62d.tar.lz
nixlib-5050c5638235ee2af92dfc769ea0476bc049e62d.tar.xz
nixlib-5050c5638235ee2af92dfc769ea0476bc049e62d.tar.zst
nixlib-5050c5638235ee2af92dfc769ea0476bc049e62d.zip
ipfs: adding mountDir options but disabling broken autoMount
Diffstat (limited to 'nixos/modules/services/network-filesystems')
-rw-r--r--nixos/modules/services/network-filesystems/ipfs.nix31
1 files changed, 23 insertions, 8 deletions
diff --git a/nixos/modules/services/network-filesystems/ipfs.nix b/nixos/modules/services/network-filesystems/ipfs.nix
index 34bb6770efd9..cd320c5c4620 100644
--- a/nixos/modules/services/network-filesystems/ipfs.nix
+++ b/nixos/modules/services/network-filesystems/ipfs.nix
@@ -6,7 +6,7 @@ let
   cfg = config.services.ipfs;
 
   ipfsFlags = toString ([
-    (optionalString  cfg.autoMount                   "--mount")
+    #(optionalString  cfg.autoMount                   "--mount")
     (optionalString  cfg.autoMigrate                 "--migrate")
     (optionalString  cfg.enableGC                    "--enable-gc")
     (optionalString (cfg.serviceFdlimit != null)     "--manage-fdlimit=false")
@@ -39,10 +39,10 @@ let
     preStart = ''
       ipfs --local config Addresses.API ${cfg.apiAddress}
       ipfs --local config Addresses.Gateway ${cfg.gatewayAddress}
-    '' + optionalString cfg.autoMount ''
+    '' + optionalString false/*cfg.autoMount*/ ''
       ipfs --local config Mounts.FuseAllowOther --json true
-      mkdir -p $(ipfs --local config Mounts.IPFS)
-      mkdir -p $(ipfs --local config Mounts.IPNS)
+      ipfs --local config Mounts.IPFS ${cfg.ipfsMountDir}
+      ipfs --local config Mounts.IPNS ${cfg.ipnsMountDir}
     '' + concatStringsSep "\n" (collect
           isString
           (mapAttrsRecursive
@@ -104,10 +104,22 @@ in {
         '';
       };
 
-      autoMount = mkOption {
-        type = types.bool;
-        default = false;
-        description = "Whether IPFS should try to mount /ipfs and /ipns at startup.";
+      #autoMount = mkOption {
+      #  type = types.bool;
+      #  default = false;
+      #  description = "Whether IPFS should try to mount /ipfs and /ipns at startup.";
+      #};
+
+      ipfsMountDir = mkOption {
+        type = types.str;
+        default = "/ipfs";
+        description = "Where to mount the IPFS namespace to";
+      };
+
+      ipnsMountDir = mkOption {
+        type = types.str;
+        default = "/ipns";
+        description = "Where to mount the IPNS namespace to";
       };
 
       gatewayAddress = mkOption {
@@ -203,6 +215,9 @@ in {
 
       preStart = ''
         install -m 0755 -o ${cfg.user} -g ${cfg.group} -d ${cfg.dataDir}
+      '' + optionalString false/*cfg.autoMount*/ ''
+        install -m 0755 -o ${cfg.user} -g ${cfg.group} -d ${cfg.ipfsMountDir}
+        install -m 0755 -o ${cfg.user} -g ${cfg.group} -d ${cfg.ipnsMountDir}
       '';
       script = ''
         if [[ ! -f ${cfg.dataDir}/config ]]; then