# This file was generated by GoReleaser. DO NOT EDIT.
# vim: set ft=nix ts=2 sw=2 sts=2 et sta
{
system ? builtins.currentSystem
, pkgs
, lib
, fetchurl
, installShellFiles
, makeWrapper
, stdenv
, fish
, bash
, ttyd
, chromium
}:
let
  shaMap = {
    i686-linux = "sha16";
    x86_64-linux = "sha1";
    armv6l-linux = "sha6";
    armv7l-linux = "sha7";
    aarch64-linux = "sha2";
    x86_64-darwin = "sha3";
    aarch64-darwin = "sha4";
  };

  urlMap = {
    i686-linux = "https://dummyhost/download/v1.2.1/foo_linux_386.tar.gz";
    x86_64-linux = "https://dummyhost/download/v1.2.1/foo_linux_amd64v1.tar.gz";
    armv6l-linux = "https://dummyhost/download/v1.2.1/foo_linux_arm6.tar.gz";
    armv7l-linux = "https://dummyhost/download/v1.2.1/foo_linux_arm7.tar.gz";
    aarch64-linux = "https://dummyhost/download/v1.2.1/foo_linux_arm64.tar.gz";
    x86_64-darwin = "https://dummyhost/download/v1.2.1/foo_darwin_amd64v1.tar.gz";
    aarch64-darwin = "https://dummyhost/download/v1.2.1/foo_darwin_arm64.tar.gz";
  };
in
pkgs.stdenv.mkDerivation {
  pname = "foo";
  version = "1.2.1";
  src = fetchurl {
    url = urlMap.${system};
    sha256 = shaMap.${system};
  };

  sourceRoot = ".";

  nativeBuildInputs = [ installShellFiles makeWrapper ];

  installPhase = ''
    mkdir -p $out/bin
    cp -vr ./foo $out/bin/foo
    wrapProgram $out/bin/foo --prefix PATH : ${lib.makeBinPath (lib.optionals stdenv.isDarwin [ chromium ] ++ lib.optionals stdenv.isLinux [ ttyd ] ++ [ fish bash ])}
    installManPage ./manpages/foo.1.gz
  '';

  system = system;

  meta = {

    sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];

    platforms = [
      "aarch64-darwin"
      "aarch64-linux"
      "armv6l-linux"
      "armv7l-linux"
      "i686-linux"
      "x86_64-darwin"
      "x86_64-linux"
    ];
  };
}
