summary refs log tree commit diff
path: root/pkgs/development/tools/cue/default.nix
blob: 9119dbce158d52fac308bdc9eeb1c4646faa7d8a (plain) (blame)
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
35
{ buildGoModule, fetchFromGitHub, lib }:

buildGoModule rec {
  pname = "cue";
  version = "0.4.1";

  src = fetchFromGitHub {
    owner = "cue-lang";
    repo = "cue";
    rev = "v${version}";
    sha256 = "1q1mkqb6fk515g556yn8ks3gqrimfbadprmbv5rill1lpipq5xbj";
  };

  vendorSha256 = "12p77a97lbff6qhncs5qx13k3wmf9hrr09mhh12isw5s0p0n53xm";

  checkPhase = "go test ./...";

  subPackages = [ "cmd/cue" ];

  ldflags = [
    "-s" "-w" "-X cuelang.org/go/cmd/cue/cmd.version=${version}"
  ];

  doInstallCheck = true;
  installCheckPhase = ''
    $out/bin/cue eval - <<<'a: "all good"' > /dev/null
  '';

  meta = {
    description = "A data constraint language which aims to simplify tasks involving defining and using data";
    homepage = "https://cuelang.org/";
    maintainers = [];
    license = lib.licenses.asl20;
  };
}