summaryrefslogtreecommitdiff
path: root/overlays/fast-cli.nix
blob: 932c5a3809f2f87c44cb11d8146613cd75da23ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ final, prev, sources, ... }: {
  fast-cli = prev.buildGoModule rec {
    pname = "fast-cli";

    inherit (sources.fast-cli) version src;
    vendorSha256 = "sha256-XM/5kUau0JBMxN0UpX6QNI31i8/+HNFvgFUFtlJsBh0=";

    preBuild = let
      goMod = prev.writeText "go.mod" ''
        module github.com/gesquive/fast-cli

        go 1.17

        require (
                github.com/dustin/go-humanize v0.0.0-20170228161531-259d2a102b87
                github.com/fatih/color v1.4.1
                github.com/gesquive/cli v0.2.0
                github.com/inconshreveable/mousetrap v1.0.0
                github.com/mattn/go-colorable v0.0.8-0.20170210172801-5411d3eea597
                github.com/mattn/go-isatty v0.0.2-0.20170307163044-57fdcb988a5c
                github.com/spf13/cobra v0.0.0-20170531045452-8d4ce3549a0b
                github.com/spf13/pflag v1.0.0
                golang.org/x/sys v0.0.0-20170213225739-e24f485414ae
        )
      '';
    in ''
      install -v -m 0644 ${goMod} ./go.mod
    '';

    ldflags = [
      "-X main.version=${prev.lib.removePrefix "v" version}"
    ];
  };
}