anchor.diff:  , buildGoModule
   , fetchFromGitHub
   , makeWrapper
  +, installShellFiles
   , buildkit
   , cni-plugins
   , extraPackages ? [ ]
  
positive.code:     wrapProgram $out/bin/nerdctl \
        --prefix PATH : "${lib.makeBinPath ([ buildkit ] ++ extraPackages)}" \
        --prefix CNI_PATH : "${cni-plugins}/bin"
    '';
  
    doInstallCheck = true;
    installCheckPhase = ''
      runHook preInstallCheck
      # nerdctl expects XDG_RUNTIME_DIR to be set
      export XDG_RUNTIME_DIR=$TMPDIR
  
      $out/bin/nerdctl --help
      # --version will error without containerd.sock access
      $out/bin/nerdctl --help | grep "${version}"
      runHook postInstallCheck
    '';
  
  
negative.code: 
  buildGoModule rec {
    pname = "nerdctl";
    version = "0.7.1";
  
    src = fetchFromGitHub {
      owner = "AkihiroSuda";
      repo = pname;
      rev = "v${version}";
      sha256 = "sha256-tMzob+ljGBKkfbxwMqy+8bqVp51Eqyx4kXhsj/LRfzQ=";
    };
  
    vendorSha256 = "sha256-zUX/kneVz8uXmxly8yqmcttK3Wj4EmBaT8gmg3hDms4=";
  
    nativeBuildInputs = [ makeWrapper installShellFiles ];
  
    preBuild = let t = "github.com/AkihiroSuda/nerdctl/pkg/version"; in
      ''
        buildFlagsArray+=("-ldflags" "-s -w -X ${t}.Version=v${version} -X ${t}.Revision=<unknown>")
      '';
  