github.com/windmeup/goreleaser@v1.21.95/internal/pipe/nix/tmpl.nix (about)

     1  # This file was generated by GoReleaser. DO NOT EDIT.
     2  # vim: set ft=nix ts=2 sw=2 sts=2 et sta
     3  {
     4  system ? builtins.currentSystem
     5  , pkgs
     6  , lib
     7  , fetchurl
     8  , installShellFiles
     9  {{- if .Dependencies }}
    10  , makeWrapper
    11  , stdenv
    12  {{- end -}}
    13  {{- range $index, $element := .Dependencies }}
    14  , {{ . -}}
    15  {{- end }}
    16  }:
    17  let
    18    shaMap = {
    19      {{- with  .Archives.linux386.Sha }}
    20      i686-linux = "{{ . }}";
    21      {{- end }}
    22      {{- with  .Archives.linuxamd64.Sha }}
    23      x86_64-linux = "{{ . }}";
    24      {{- end }}
    25      {{- with  .Archives.linuxarm6.Sha }}
    26      armv6l-linux = "{{ . }}";
    27      {{- end }}
    28      {{- with  .Archives.linuxarm7.Sha }}
    29      armv7l-linux = "{{ . }}";
    30      {{- end }}
    31      {{- with  .Archives.linuxarm64.Sha }}
    32      aarch64-linux = "{{ . }}";
    33      {{- end }}
    34      {{- with  .Archives.darwinamd64.Sha }}
    35      x86_64-darwin = "{{ . }}";
    36      {{- end }}
    37      {{- with  .Archives.darwinarm64.Sha }}
    38      aarch64-darwin = "{{ . }}";
    39      {{- end }}
    40    };
    41  
    42    urlMap = {
    43      {{- with  .Archives.linux386.URL }}
    44      i686-linux = "{{ . }}";
    45      {{- end }}
    46      {{- with  .Archives.linuxamd64.URL }}
    47      x86_64-linux = "{{ . }}";
    48      {{- end }}
    49      {{- with  .Archives.linuxarm6.URL }}
    50      armv6l-linux = "{{ . }}";
    51      {{- end }}
    52      {{- with  .Archives.linuxarm7.URL }}
    53      armv7l-linux = "{{ . }}";
    54      {{- end }}
    55      {{- with  .Archives.linuxarm64.URL }}
    56      aarch64-linux = "{{ . }}";
    57      {{- end }}
    58      {{- with  .Archives.darwinamd64.URL }}
    59      x86_64-darwin = "{{ . }}";
    60      {{- end }}
    61      {{- with  .Archives.darwinarm64.URL }}
    62      aarch64-darwin = "{{ . }}";
    63      {{- end }}
    64    };
    65  in
    66  pkgs.stdenv.mkDerivation {
    67    pname = "{{ .Name }}";
    68    version = "{{ .Version }}";
    69    src = fetchurl {
    70      url = urlMap.${system};
    71      sha256 = shaMap.${system};
    72    };
    73  
    74    sourceRoot = "{{ .SourceRoot }}";
    75  
    76    nativeBuildInputs = [ {{ range $input, $plat := .Inputs }}{{ . }} {{ end }}];
    77  
    78    installPhase = ''
    79      {{- range $index, $element := .Install }}
    80      {{ . -}}
    81      {{- end }}
    82    '';
    83  
    84    {{- with .PostInstall }}
    85    postInstall = ''
    86      {{- range $index, $element := . }}
    87      {{ . -}}
    88      {{- end }}
    89    '';
    90    {{- end }}
    91  
    92    system = system;
    93  
    94    meta = {
    95      {{- with .Description }}
    96      description = "{{ . }}";
    97      {{- end }}
    98      {{- with .Homepage }}
    99      homepage = "{{ . }}";
   100      {{- end }}
   101      {{- with .License }}
   102      license = lib.licenses.{{ . }};
   103      {{- end }}
   104  
   105      sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
   106  
   107      platforms = [
   108        {{- range $index, $plat := .Platforms }}
   109        "{{ . }}"
   110        {{- end }}
   111      ];
   112    };
   113  }