From 0748ebe40bd13ea9e7d4b3ffa13475dd719faeab Mon Sep 17 00:00:00 2001 From: Dave Aitken Date: Wed, 23 Oct 2024 13:36:16 +0100 Subject: [PATCH] tidy: nixpkgs rather than dev opam scope for lsp/utop --- flake.lock | 22 +++------------------- flake.nix | 16 +++++----------- 2 files changed, 8 insertions(+), 30 deletions(-) diff --git a/flake.lock b/flake.lock index aed4d7e..49c40f0 100644 --- a/flake.lock +++ b/flake.lock @@ -67,11 +67,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1709230475, - "narHash": "sha256-QI/0GiTvWxhBJ/bpredarfAUARnP6zE1vCOifsZ220A=", + "lastModified": 1729658218, + "narHash": "sha256-9Rg+AqLqvqqJniP/OQB3GtgXoAd8IlazsHp97va042Y=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b5f6e3881acf8ca8a35b8cdb8d4021e5bd469a4e", + "rev": "dfffb2e7a52d29a0ef8e21ec8a0f30487b227f1a", "type": "github" }, "original": { @@ -80,21 +80,6 @@ "type": "indirect" } }, - "nixpkgs2305": { - "locked": { - "lastModified": 1704290814, - "narHash": "sha256-LWvKHp7kGxk/GEtlrGYV68qIvPHkU9iToomNFGagixU=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "70bdadeb94ffc8806c0570eb5c2695ad29f0e421", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixos-23.05", - "type": "indirect" - } - }, "nixpkgs_2": { "locked": { "lastModified": 1682362401, @@ -194,7 +179,6 @@ "inputs": { "flake-utils": "flake-utils", "nixpkgs": "nixpkgs", - "nixpkgs2305": "nixpkgs2305", "opam-nix": "opam-nix", "opam-repository": "opam-repository" } diff --git a/flake.nix b/flake.nix index 8fe9793..e6f926f 100644 --- a/flake.nix +++ b/flake.nix @@ -1,8 +1,8 @@ { inputs = { nixpkgs.url = "nixpkgs/nixpkgs-unstable"; - flake-utils.url = "github:numtide/flake-utils"; + opam-nix = { url = "github:tweag/opam-nix"; inputs.opam-repository.follows = "opam-repository"; @@ -19,7 +19,7 @@ pkgs = nixpkgs.legacyPackages.${system}; fs = pkgs.lib.fileset; on = opam-nix.lib.${system}; - ocaml-version = "5.1.0"; + ocaml-version = "5.1.1"; ocaml-base-compiler = ocaml-version; # List of opam files you which to be read by opam-nix @@ -61,13 +61,6 @@ fileset = fs.unions opamFiles; }) { inherit ocaml-base-compiler; }); - # build any dev deps on the correct ocaml version, without conflicting with project deps. - devOpamScope = (on.queryToScope { repos = [ opam-repository ]; } { - inherit ocaml-base-compiler; - ocaml-lsp-server = "*"; - utop = "*"; - }); - gcloud-cli = pkgs.stdenv.mkDerivation { pname = "gcloud-cli"; version = "1.0.0"; @@ -98,9 +91,10 @@ packages.gcloud-cli = gcloud-cli; packages.default = pkgs.mkShell { + dontDetectOcamlConflicts = true; buildInputs = (map (p: opamScope.${p}) opamFilePackageNames) ++ [ - devOpamScope.utop - devOpamScope.ocaml-lsp-server + pkgs.ocaml-ng.ocamlPackages_5_1.utop + pkgs.ocaml-ng.ocamlPackages_5_1.ocaml-lsp pkgs.ocamlformat_0_22_4 ]; };