anchor.diff:          type = types.str;
           default = defaultDataDir;
           description = "The data dir for IPFS";
  +      };
  +
  +      defaultMode = mkOption {
  +        description = "systemd service that is enabled by default";
  +        type = types.enum [ "online" "offline" "norouting" ];
  +        default = "online";
         };
   
         autoMigrate = mkOption {
  
positive.code:     systemd.services.ipfs = {
        description = "IPFS Daemon";
  
        wantedBy = [ "multi-user.target" ];
        after = [ "network.target" "local-fs.target" "ipfs-init.service" ];
  
        conflicts = [ "ipfs-offline.service" ];
        wants = [ "ipfs-init.service" ];
  
        environment.IPFS_PATH = cfg.dataDir;
  
negative.code:         RestartSec = 1;
        };
      };
  
      systemd.services.ipfs-norouting = {
        description = "IPFS Daemon (no routing mode)";
  
        wantedBy = mkIf (cfg.defaultMode == "norouting") [ "multi-user.target" ];
  
        after = [ "local-fs.target" "ipfs-init.service" ];
  
        conflicts = [ "ipfs.service" "ipfs-offline.service"];
        wants = [ "ipfs-init.service" ];
  
        environment.IPFS_PATH = cfg.dataDir;
  
        path  = [ pkgs.ipfs ];
  
        serviceConfig = {
          ExecStart = "${ipfs}/bin/ipfs daemon ${ipfsFlags} --routing=none";
          User = cfg.user;
          Group = cfg.group;
          Restart = "on-failure";
          RestartSec = 1;
        };
      };
  
    };
  }
  