about summary refs log tree commit diff
path: root/pkgs/by-name/cu/cue/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/cu/cue/package.nix')
-rw-r--r--pkgs/by-name/cu/cue/package.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/pkgs/by-name/cu/cue/package.nix b/pkgs/by-name/cu/cue/package.nix
new file mode 100644
index 0000000000000..6f86bd745a242
--- /dev/null
+++ b/pkgs/by-name/cu/cue/package.nix
@@ -0,0 +1,54 @@
+{ buildGoModule
+, fetchFromGitHub
+, lib
+, installShellFiles
+, testers
+, cue
+, callPackage
+}:
+
+buildGoModule rec {
+  pname = "cue";
+  version = "0.8.0";
+
+  src = fetchFromGitHub {
+    owner = "cue-lang";
+    repo = "cue";
+    rev = "v${version}";
+    hash = "sha256-7gn8/35rpbyzSP4ZM21ig6Wsq5Tp18x1Ex/IVb2iE7k=";
+  };
+
+  vendorHash = "sha256-0OZtKIDdEnQLnSj109EpGvaZvMIy7gPAZ+weHzYKGSg=";
+
+  subPackages = [ "cmd/*" ];
+
+  nativeBuildInputs = [ installShellFiles ];
+
+  ldflags = [ "-s" "-w" "-X cuelang.org/go/cmd/cue/cmd.version=${version}" ];
+
+  postInstall = ''
+    installShellCompletion --cmd cue \
+      --bash <($out/bin/cue completion bash) \
+      --fish <($out/bin/cue completion fish) \
+      --zsh <($out/bin/cue completion zsh)
+  '';
+
+  passthru = {
+    writeCueValidator = callPackage ./validator.nix { };
+    tests = {
+      test-001-all-good = callPackage ./tests/001-all-good.nix { };
+      version = testers.testVersion {
+        package = cue;
+        command = "cue version";
+      };
+    };
+  };
+
+  meta = with lib;  {
+    description = "A data constraint language which aims to simplify tasks involving defining and using data";
+    homepage = "https://cuelang.org/";
+    license = lib.licenses.asl20;
+    maintainers = with maintainers; [ aaronjheng ];
+    mainProgram = "cue";
+  };
+}