anchor.diff:  with lib;
   
   let
  -  inherit (pkgs) ipfs;
  +  inherit (pkgs) ipfs runCommand makeWrapper;
   
     cfg = config.services.ipfs;
   
     ipfsFlags = ''${if cfg.autoMigrate then "--migrate" else ""} ${if cfg.enableGC then "--enable-gc" else ""} ${toString cfg.extraFlags}'';
   
  +  pathEnv = { IPFS_PATH = cfg.dataDir; };
  +
  +  # 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}
  +  '';
   in
   
   {
  
positive.code:   ###### implementation
  
    config = mkIf cfg.enable {
      environment.systemPackages = [ pkgs.ipfs ];
  
      users.extraUsers = mkIf (cfg.user == "ipfs") {
        ipfs = {
  
negative.code: 
        path  = [ pkgs.ipfs ];
  
        environment = pathEnv;
  
        serviceConfig = {
          ExecStart = "${ipfs}/bin/ipfs daemon ${ipfsFlags} --offline";
          User = cfg.user;
  