From aaebf3f08eb99041d709542cf7cba2c9fb9371f9 Mon Sep 17 00:00:00 2001 From: Kyle Chui <48545987+kylechui@users.noreply.github.com> Date: Sun, 16 Jun 2024 19:12:52 -0700 Subject: [PATCH] feat: Update `coq-lsp`. (#54) --- flake.lock | 19 ++++++++++++++++++- flake.nix | 36 +++++++++++++++++++++++++----------- 2 files changed, 43 insertions(+), 12 deletions(-) diff --git a/flake.lock b/flake.lock index 5e0824e..0f01b1e 100644 --- a/flake.lock +++ b/flake.lock @@ -16,9 +16,26 @@ "type": "github" } }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1718318537, + "narHash": "sha256-4Zu0RYRcAY/VWuu6awwq4opuiD//ahpc2aFHg2CWqFY=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "e9ee548d90ff586a6471b4ae80ae9cfcbceb3420", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "nixpkgs-unstable": "nixpkgs-unstable" } } }, diff --git a/flake.nix b/flake.nix index 26a9e13..e3b1128 100644 --- a/flake.nix +++ b/flake.nix @@ -1,13 +1,23 @@ { description = "Local development environment for 2ControlVerification"; - inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; }; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + }; - outputs = { self, nixpkgs }: + outputs = + { + self, + nixpkgs, + nixpkgs-unstable, + }: let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; + pkgs-unstable = nixpkgs-unstable.legacyPackages.${system}; coq-quantumlib-version = "v1.4.0"; - in let + in + let coq-quantumlib = pkgs.coqPackages.mkCoqDerivation { pname = "quantumlib"; owner = "inQWIRE"; @@ -20,15 +30,19 @@ }; useDune = true; }; - in { + in + { devShell.${system} = pkgs.mkShell { - packages = [ - pkgs.coq - pkgs.coq.ocamlPackages.ocaml - pkgs.coq.ocamlPackages.dune_3 - coq-quantumlib - ] ++ pkgs.lib.optional (builtins.getEnv "CI" != "true") - pkgs.coqPackages.coq-lsp; # Don't build the LSP in GitHub Action + packages = + [ + pkgs.coq + pkgs.coq.ocamlPackages.ocaml + pkgs.coq.ocamlPackages.dune_3 + coq-quantumlib + ] + ++ pkgs.lib.optional (builtins.getEnv "CI" != "true") ( + pkgs.coqPackages.coq-lsp.override { coq = pkgs.coq_8_18; } + ); # Don't build the LSP in GitHub Action }; }; }