diff --git a/hls-hlint-plugin.cabal b/hls-hlint-plugin.cabal
--- a/hls-hlint-plugin.cabal
+++ b/hls-hlint-plugin.cabal
@@ -1,6 +1,6 @@
 cabal-version: 2.4
 name:          hls-hlint-plugin
-version:       1.1.2.0
+version:       2.0.0.0
 synopsis:      Hlint integration plugin with Haskell Language Server
 description:
   Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>
@@ -30,6 +30,8 @@
   manual:      True
 
 library
+  if impl(ghc >= 9.5)
+    buildable: False
   exposed-modules:    Ide.Plugin.Hlint
   hs-source-dirs:     src
   build-depends:
@@ -45,11 +47,10 @@
     , extra
     , filepath
     , ghc-exactprint        >=0.6.3.4
-    , ghcide                ^>=1.9
+    , ghcide                == 2.0.0.0
     , hashable
     , hlint                 < 3.6
-    , hls-plugin-api        ^>=1.6
-    , hslogger
+    , hls-plugin-api        == 2.0.0.0
     , lens
     , lsp
     , refact
@@ -77,6 +78,8 @@
     TypeOperators
 
 test-suite tests
+  if impl(ghc >= 9.5)
+    buildable: False
   type:             exitcode-stdio-1.0
   default-language: Haskell2010
   hs-source-dirs:   test
@@ -89,7 +92,7 @@
     , filepath
     , hls-hlint-plugin
     , hls-plugin-api
-    , hls-test-utils      ^>=1.5
+    , hls-test-utils      == 2.0.0.0
     , lens
     , lsp-types
     , text
diff --git a/src/Ide/Plugin/Hlint.hs b/src/Ide/Plugin/Hlint.hs
--- a/src/Ide/Plugin/Hlint.hs
+++ b/src/Ide/Plugin/Hlint.hs
@@ -20,6 +20,11 @@
 
 {-# OPTIONS_GHC -Wno-orphans   #-}
 
+-- On 9.4 we get a new redundant constraint warning, but deleting the
+-- constraint breaks the build on earlier versions. Rather than apply
+-- lots of CPP, we just disable the warning until later.
+{-# OPTIONS_GHC -Wno-redundant-constraints   #-}
+
 #ifdef HLINT_ON_GHC_LIB
 #define MIN_GHC_API_VERSION(x,y,z) MIN_VERSION_ghc_lib_parser(x,y,z)
 #else
@@ -134,8 +139,11 @@
                                                                      lineSplitTextEdits,
                                                                      nextPragmaLine)
 import           GHC.Generics                                       (Generic)
+#if MIN_VERSION_apply_refact(0,12,0)
+#else
 import           System.Environment                                 (setEnv,
                                                                      unsetEnv)
+#endif
 import           Text.Regex.TDFA.Text                               ()
 -- ---------------------------------------------------------------------
 
