about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-rpc-lib.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-11-05 09:32:31 +0100
committerAlyssa Ross <hi@alyssa.is>2023-11-05 09:32:31 +0100
commit480416cc0d7e508b652c516af8d7342e3b1e59e3 (patch)
treed64d990b0d7cc1f80dca687b48563bc71628b55e /nixpkgs/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-rpc-lib.nix
parent05f40ff2bfe9c68198664c38d65816f677ac7ed4 (diff)
parentfa804edfb7869c9fb230e174182a8a1a7e512c40 (diff)
downloadnixlib-480416cc0d7e508b652c516af8d7342e3b1e59e3.tar
nixlib-480416cc0d7e508b652c516af8d7342e3b1e59e3.tar.gz
nixlib-480416cc0d7e508b652c516af8d7342e3b1e59e3.tar.bz2
nixlib-480416cc0d7e508b652c516af8d7342e3b1e59e3.tar.lz
nixlib-480416cc0d7e508b652c516af8d7342e3b1e59e3.tar.xz
nixlib-480416cc0d7e508b652c516af8d7342e3b1e59e3.tar.zst
nixlib-480416cc0d7e508b652c516af8d7342e3b1e59e3.zip
Merge branch 'nixos-unstable' of https://github.com/NixOS/nixpkgs into HEAD
Conflicts:
	nixpkgs/pkgs/servers/pr-tracker/default.nix
Diffstat (limited to 'nixpkgs/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-rpc-lib.nix')
-rw-r--r--nixpkgs/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-rpc-lib.nix29
1 files changed, 10 insertions, 19 deletions
diff --git a/nixpkgs/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-rpc-lib.nix b/nixpkgs/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-rpc-lib.nix
index a4492b2ead38..e1f5f29aa2fb 100644
--- a/nixpkgs/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-rpc-lib.nix
+++ b/nixpkgs/pkgs/development/ocaml-modules/ocamlformat/ocamlformat-rpc-lib.nix
@@ -1,25 +1,16 @@
-{ lib, fetchurl, buildDunePackage, ocaml, csexp, sexplib0 }:
+# Version can be selected with the 'version' argument, see generic.nix.
+{ lib, fetchurl, buildDunePackage, ocaml, csexp, sexplib0, callPackage, ... }@args:
 
-# for compat with ocaml-lsp
-let source =
-  if lib.versionAtLeast ocaml.version "4.13"
-  then {
-    version = "0.26.0";
-    sha256 = "sha256-AxSUq3cM7xCo9qocvrVmDkbDqmwM1FexEP7IWadeh30=";
-  } else {
-    version = "0.20.0";
-    sha256 = "sha256-JtmNCgwjbCyUE4bWqdH5Nc2YSit+rekwS43DcviIfgk=";
-  };
-in
+let
+  # for compat with ocaml-lsp
+  version_arg =
+    if lib.versionAtLeast ocaml.version "4.13" then {} else { version = "0.20.0"; };
 
-buildDunePackage rec {
-  pname = "ocamlformat-rpc-lib";
-  inherit (source) version;
+  inherit (callPackage ./generic.nix (args // version_arg)) src version;
 
-  src = fetchurl {
-    url = "https://github.com/ocaml-ppx/ocamlformat/releases/download/${version}/ocamlformat-${version}.tbz";
-    inherit (source) sha256;
-  };
+in buildDunePackage rec {
+  pname = "ocamlformat-rpc-lib";
+  inherit src version;
 
   minimalOCamlVersion = "4.08";
   duneVersion = "3";