anchor.diff:          description = ''
             Whether IPFS should try to migrate the file system automatically.
           '';
  +      };
  +
  +      autoMount = mkOption {
  +        type = types.bool;
  +        default = false;
  +        description = "Whether IPFS should try to mount /ipfs and /ipns at startup.";
         };
   
         gatewayAddress = mkOption {
  
positive.code:       preStart = ''
          install -m 0755 -o ${cfg.user} -g ${cfg.group} -d ${cfg.dataDir}
        '';
        script =  ''
          if [[ ! -f ${cfg.dataDir}/config ]]; then
            ${ipfs}/bin/ipfs init ${optionalString cfg.emptyRepo "-e"}
          fi
          ${ipfs}/bin/ipfs --local config Addresses.API ${cfg.apiAddress}
          ${ipfs}/bin/ipfs --local config Addresses.Gateway ${cfg.gatewayAddress}
        '';
  
        serviceConfig = {
  
negative.code:   # Wrapping the ipfs binary with the environment variable IPFS_PATH set to dataDir because we can't set it in the user environment
    wrapped = runCommand "ipfs" { buildInputs = [ makeWrapper ]; } ''
      mkdir -p "$out/bin"
      makeWrapper "${ipfs}/bin/ipfs" "$out/bin/ipfs" \
        --set IPFS_PATH ${cfg.dataDir} \
        --prefix PATH : /run/wrappers/bin
    '';
  in
  
  