From f738706ba587856d00f66c9e3894817a44ec83c2 Mon Sep 17 00:00:00 2001 From: "(cdep)illabout" Date: Sat, 21 Oct 2023 20:05:20 +0900 Subject: [PATCH 1/6] Remove unused imports in Termonad.Config.Colour --- src/Termonad/Config/Colour.hs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Termonad/Config/Colour.hs b/src/Termonad/Config/Colour.hs index 3b59dee..cbe0a4e 100644 --- a/src/Termonad/Config/Colour.hs +++ b/src/Termonad/Config/Colour.hs @@ -87,7 +87,7 @@ module Termonad.Config.Colour -- $setup ) where -import Termonad.Prelude hiding ((\\), index) +import Termonad.Prelude import Control.Lens ((%~), makeLensesFor) import Data.Colour @@ -124,9 +124,6 @@ import GI.Vte , terminalSetColorHighlight , terminalSetColorHighlightForeground ) -import Text.Printf (printf) -import Text.Show (showString) - import Termonad.Lenses (lensCreateTermHook, lensHooks) import Termonad.Types ( Option(Unset) @@ -134,6 +131,7 @@ import Termonad.Types , TMState , whenSet ) +import Text.Printf (printf) -- $setup -- >>> import Data.Colour.Names (green, red) From 3c5132c53646d1d60ec0e21c241c2f2418a5918a Mon Sep 17 00:00:00 2001 From: "(cdep)illabout" Date: Sat, 21 Oct 2023 20:08:15 +0900 Subject: [PATCH 2/6] Remove Control.Monad.Fail imports --- src/Termonad/App.hs | 1 - src/Termonad/Gtk.hs | 1 - src/Termonad/Types.hs | 1 - 3 files changed, 3 deletions(-) diff --git a/src/Termonad/App.hs b/src/Termonad/App.hs index 5ce3e40..faa150f 100644 --- a/src/Termonad/App.hs +++ b/src/Termonad/App.hs @@ -6,7 +6,6 @@ import Termonad.Prelude import Config.Dyre (wrapMain, newParams) import Control.Lens ((^.), (^..), over, set, view, ix) -import Control.Monad.Fail (fail) import Data.FileEmbed (embedFile) import Data.FocusList (focusList, moveFromToFL, updateFocusFL) import qualified Data.List as List diff --git a/src/Termonad/Gtk.hs b/src/Termonad/Gtk.hs index 4aab406..26b42c7 100644 --- a/src/Termonad/Gtk.hs +++ b/src/Termonad/Gtk.hs @@ -17,7 +17,6 @@ module Termonad.Gtk where import Termonad.Prelude -import Control.Monad.Fail (MonadFail, fail) import Data.GI.Base (ManagedPtr, withManagedPtr) import Data.Text (unpack) import GHC.Stack (HasCallStack) diff --git a/src/Termonad/Types.hs b/src/Termonad/Types.hs index 99a320b..11f9cd8 100644 --- a/src/Termonad/Types.hs +++ b/src/Termonad/Types.hs @@ -5,7 +5,6 @@ module Termonad.Types where import Termonad.Prelude import Control.Lens (ifoldMap) -import Control.Monad.Fail (fail) import Data.FocusList (FocusList, emptyFL, getFocusItemFL, lengthFL) import Data.Foldable (toList) import Data.Unique (Unique, hashUnique, newUnique) From cd6dbff919ac280d8ec6bd205b39acbf29facc86 Mon Sep 17 00:00:00 2001 From: "(cdep)illabout" Date: Sat, 21 Oct 2023 20:10:18 +0900 Subject: [PATCH 3/6] Rearrange imports --- src/Termonad/Term.hs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Termonad/Term.hs b/src/Termonad/Term.hs index e3b2142..e062922 100644 --- a/src/Termonad/Term.hs +++ b/src/Termonad/Term.hs @@ -140,15 +140,23 @@ import Termonad.Types , TMState , TMState'(TMState, tmStateConfig, tmStateFontDesc) , TMTerm - , TMWindow + , TMWindowId , assertInvariantTMState , createTMNotebookTab + , getNotebookFromTMState + , getTMNotebookFromTMState + , getTMNotebookFromTMState' + , getTMWindowFromTMState + , getTMWindowFromWins , newTMTerm , pid , tmNotebook , tmNotebookTabTerm , tmNotebookTabTermContainer - , tmNotebookTabs, TMWindowId, tmStateWindows, getTMWindowFromWins, tmWindowNotebook, getTMWindowFromTMState, getNotebookFromTMState, getTMNotebookFromTMState, getTMNotebookFromTMState', tmWindowAppWin + , tmNotebookTabs + , tmStateWindows + , tmWindowAppWin + , tmWindowNotebook ) focusTerm :: Int -> TMState -> TMWindowId -> IO () From 8d0698f42ff794fb280b620bc5252a018749ac90 Mon Sep 17 00:00:00 2001 From: "(cdep)illabout" Date: Sat, 21 Oct 2023 20:11:43 +0900 Subject: [PATCH 4/6] Remove import of Text.Show --- src/Termonad/Types.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Termonad/Types.hs b/src/Termonad/Types.hs index 11f9cd8..31f0172 100644 --- a/src/Termonad/Types.hs +++ b/src/Termonad/Types.hs @@ -31,7 +31,6 @@ import GI.Vte (Terminal, CursorBlinkMode(..)) import Termonad.Gtk (widgetEq) import Termonad.IdMap (IdMap, IdMapKey, singletonIdMap, lookupIdMap) import Text.Pretty.Simple (pPrint) -import Text.Show (ShowS, showParen, showString) -- | A wrapper around a VTE 'Terminal'. This also stores the process ID of the -- process running on this terminal, as well as a 'Unique' that can be used for From ce4b96651233a5be4983140b102f3a11fccce472 Mon Sep 17 00:00:00 2001 From: "(cdep)illabout" Date: Sat, 21 Oct 2023 21:28:31 +0900 Subject: [PATCH 5/6] Add zlib to simple-cabal-shell --- .nix-helpers/simple-cabal-shell.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/.nix-helpers/simple-cabal-shell.nix b/.nix-helpers/simple-cabal-shell.nix index c10dd6a..e3c07da 100644 --- a/.nix-helpers/simple-cabal-shell.nix +++ b/.nix-helpers/simple-cabal-shell.nix @@ -120,5 +120,6 @@ pkgs.mkShell { pkgs.xorg.libXdmcp pkgs.xorg.libxcb pkgs.xorg.libXtst + pkgs.zlib ]; } From 6382b48de44fc7c3105fad4595236379f0b21d48 Mon Sep 17 00:00:00 2001 From: "(cdep)illabout" Date: Sat, 21 Oct 2023 21:29:10 +0900 Subject: [PATCH 6/6] Make sure cabal store is cached in simple cabal shell job --- .github/workflows/ci.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e87921e..e1a6fdf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -147,10 +147,12 @@ jobs: - uses: DeterminateSystems/magic-nix-cache-action@v2 - # TODO: This cache actually needs to be keyed on the hash of the + # TODO: These caches actually needs to be keyed on the hash of the # ./nix-helpers/simple-cabal-shell.nix derivation. If that derivation # changes, then we really, really should not reuse the same - # ~/.cabal/store directory. + # ~/.cabal/store directory (since there is the possibility of getting + # into a cabal hell, where Haskell libraries in the Cabal store are linked to + # different, incompatible system libraries). # # It is possible to get the hash of this derivation with a command like: # @@ -158,9 +160,12 @@ jobs: # # Just need to load this into a variable, and throw it in the following key name - uses: actions/cache@v3 - name: Cache cabal-store + name: Cache cabal store with: - path: ~/.config/cabal/store + path: | + ~/.cabal/store + ~/.config/cabal/store + ~/.local/state/cabal/store key: nix-simple-cabal-shell - name: cabal update