packages feed

termonad 4.2.0.1 → 4.3.0.0

raw patch · 15 files changed

+299/−73 lines, 15 filesdep ~basesetup-changednew-component:exe:termonad-example-colour-extension-oneDarkProPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base

API changes (from Hackage documentation)

- Termonad.Pcre: inline_c_ffi_6989586621679104355 :: IO CUInt
+ Termonad.Config: [enableSixel] :: ConfigOptions -> !Bool
+ Termonad.Gtk: terminalSetEnableSixelIfExists :: (HasCallStack, MonadIO m, IsTerminal t) => t -> Bool -> m ()
+ Termonad.Lenses: lensEnableSixel :: Lens' ConfigOptions Bool
+ Termonad.Pcre: inline_c_ffi_6989586621679104993 :: IO CUInt
+ Termonad.Prelude: flushTBQueue :: TBQueue a -> STM [a]
+ Termonad.Prelude: lengthTBQueue :: TBQueue a -> STM Natural
+ Termonad.Types: [enableSixel] :: ConfigOptions -> !Bool
- Termonad.Config: ConfigOptions :: !FontConfig -> !ShowScrollbar -> !Integer -> !Bool -> !Text -> !Bool -> !ShowTabBar -> !CursorBlinkMode -> !Bool -> ConfigOptions
+ Termonad.Config: ConfigOptions :: !FontConfig -> !ShowScrollbar -> !Integer -> !Bool -> !Text -> !Bool -> !ShowTabBar -> !CursorBlinkMode -> !Bool -> !Bool -> ConfigOptions
- Termonad.Config.Colour: lensBackgroundColour :: forall c_a1iqF. Lens' (ColourConfig c_a1iqF) (Option c_a1iqF)
+ Termonad.Config.Colour: lensBackgroundColour :: forall c_a1j6Z. Lens' (ColourConfig c_a1j6Z) (Option c_a1j6Z)
- Termonad.Config.Colour: lensCursorBgColour :: forall c_a1iqF. Lens' (ColourConfig c_a1iqF) (Option c_a1iqF)
+ Termonad.Config.Colour: lensCursorBgColour :: forall c_a1j6Z. Lens' (ColourConfig c_a1j6Z) (Option c_a1j6Z)
- Termonad.Config.Colour: lensCursorFgColour :: forall c_a1iqF. Lens' (ColourConfig c_a1iqF) (Option c_a1iqF)
+ Termonad.Config.Colour: lensCursorFgColour :: forall c_a1j6Z. Lens' (ColourConfig c_a1j6Z) (Option c_a1j6Z)
- Termonad.Config.Colour: lensForegroundColour :: forall c_a1iqF. Lens' (ColourConfig c_a1iqF) (Option c_a1iqF)
+ Termonad.Config.Colour: lensForegroundColour :: forall c_a1j6Z. Lens' (ColourConfig c_a1j6Z) (Option c_a1j6Z)
- Termonad.Config.Colour: lensHighlightBgColour :: forall c_a1iqF. Lens' (ColourConfig c_a1iqF) (Option c_a1iqF)
+ Termonad.Config.Colour: lensHighlightBgColour :: forall c_a1j6Z. Lens' (ColourConfig c_a1j6Z) (Option c_a1j6Z)
- Termonad.Config.Colour: lensHighlightFgColour :: forall c_a1iqF. Lens' (ColourConfig c_a1iqF) (Option c_a1iqF)
+ Termonad.Config.Colour: lensHighlightFgColour :: forall c_a1j6Z. Lens' (ColourConfig c_a1j6Z) (Option c_a1j6Z)
- Termonad.Config.Colour: lensPalette :: forall c_a1iqF. Lens' (ColourConfig c_a1iqF) (Palette c_a1iqF)
+ Termonad.Config.Colour: lensPalette :: forall c_a1j6Z. Lens' (ColourConfig c_a1j6Z) (Palette c_a1j6Z)
- Termonad.Types: ConfigOptions :: !FontConfig -> !ShowScrollbar -> !Integer -> !Bool -> !Text -> !Bool -> !ShowTabBar -> !CursorBlinkMode -> !Bool -> ConfigOptions
+ Termonad.Types: ConfigOptions :: !FontConfig -> !ShowScrollbar -> !Integer -> !Bool -> !Text -> !Bool -> !ShowTabBar -> !CursorBlinkMode -> !Bool -> !Bool -> ConfigOptions

Files

.nix-helpers/overlays.nix view
@@ -66,10 +66,10 @@     # not given by the user.     termonadKnownWorkingHaskellPkgSet = self.haskell.packages.${self.termonadCompilerVersion}; -    # See ./nixpkgs.nix for an explanation of that this does.+    # See ./nixpkgs.nix for an explanation of what this does.     termonadBuildExamples = false; -    # See ./nixpkgs.nix for an explanation of that this does.+    # See ./nixpkgs.nix for an explanation of what this does.     termonadIndexTermonad = false;      # This is a shell environment for hacking on Termonad with cabal.  See the@@ -88,6 +88,7 @@           self.glade           self.haskellPackages.ghcid           self.hlint+          self.termonadKnownWorkingHaskellPkgSet.haskell-language-server         ];       in @@ -100,12 +101,18 @@                   self.termonadKnownWorkingHaskellPkgSet.ghcWithHoogle (hpkgs: [ hpkgs.termonad ]);               in               oldAttrs.nativeBuildInputs ++ convenientNativeBuildTools ++ [ ghcEnvWithTermonad ];+            # Termonad can't be loaded in `cabal repl` unless GHC knows how to find zlib:+            # https://discourse.nixos.org/t/shared-libraries-error-with-cabal-repl-in-nix-shell/8921/10+            LD_LIBRARY_PATH = self.lib.makeLibraryPath [ self.zlib ];           })         else           self.termonadKnownWorkingHaskellPkgSet.shellFor {             withHoogle = true;             packages = hpkgs: [ hpkgs.termonad ];             nativeBuildInputs = termonadEnv.nativeBuildInputs ++ convenientNativeBuildTools;+            # Termonad can't be loaded in `cabal repl` unless GHC knows how to find zlib:+            # https://discourse.nixos.org/t/shared-libraries-error-with-cabal-repl-in-nix-shell/8921/10+            LD_LIBRARY_PATH = self.lib.makeLibraryPath [ self.zlib ];           };      # Default Haskell packages that you can use in your Termonad configuration.@@ -127,8 +134,8 @@       self.stdenv.mkDerivation {         name = "termonad-with-packages-ghc-${env.version}";         buildInputs = [-          self.gdk_pixbuf-          self.gnome3.adwaita-icon-theme+          self.gdk-pixbuf+          self.gnome.adwaita-icon-theme           self.hicolor-icon-theme         ];         nativeBuildInputs = [ self.wrapGAppsHook ];
CHANGELOG.md view
@@ -1,3 +1,12 @@+## 4.3.0.0++*   Add SIXEL support.  Note that you will need to set `enableSixel` to `True`+    in your `ConfigOptions`, as well as using a version of VTE that is >= 0.63+    for this option to have any affect.  There is also a report that even if you+    enable SIXEL and have a supported version of VTE, SIXEL doesn't work.  See+    the linked PR for more information. Thanks [@junjihashimoto](https://github.com/junjihashimoto)!+    [#219](https://github.com/cdepillabout/termonad/pull/219)+ ## 4.2.0.1  *   Added an
README.md view
@@ -118,31 +118,49 @@  ### Nix -If you have `nix` installed, you should be able to use it to build Termonad.+If you have `nix` installed, you should be able to use it to obtain Termonad. This means that it will work on NixOS, or with `nix` on another distro.  There-are two different ways to use `nix` to build Termonad:+are three different ways to use `nix` to get Termonad: -The first is using `stack`.  The following commands install `stack` for your-user, clone this repository, and install the `termonad` binary to `~/.local/bin/`:+1.  Get Termonad from Nixpkgs.  Termonad is provided as a top-level `termonad`+    attribute in Nixpkgs. -```sh-$ nix-env -i stack-$ git clone https://github.com/cdepillabout/termonad-$ cd termonad/-$ stack --nix install-```+    For instance, run a `nix-shell` with Termonad: -(_edit_: Building with `stack` using Nix-integration does not currently work.-See [#99](https://github.com/cdepillabout/termonad/issues/99).)+    ```console+    $ nix-shell -p termonad+    $ termonad   # run termonad within the nix-shell+    ``` -The second is using the normal `nix-build` machinery.  The following commands-clone this repository and build the `termonad` binary at `./result/bin/`:+    You can also install `termonad` with tools like `nix-env` or home-manager.+    If you're using NixOS, you can add `termonad` to your+    `environment.systemPackages` list. -```sh-$ git clone https://github.com/cdepillabout/termonad-$ cd termonad/-$ nix-build-```+    Keep in mind that if you're using an old release of NixOS, you'll likely+    get an older version of Termonad.++2.  Build Termonad using the code in this repository. The following commands+    clone this repo and build the `termonad` binary at `./result/bin/`:++    ```sh+    $ git clone https://github.com/cdepillabout/termonad+    $ cd termonad/+    $ nix-build+    ```++3.  Build Termonad using `stack` with Nix-integration. The following commands+    install `stack` for your user, clone this repository, and install the+    `termonad` binary to `~/.local/bin/`:++    ```sh+    $ nix-env -i stack+    $ git clone https://github.com/cdepillabout/termonad+    $ cd termonad/+    $ stack --nix install+    ```++    (_edit_: Building with `stack` using Nix-integration does not currently work.+    See [#99](https://github.com/cdepillabout/termonad/issues/99).)  ### Mac OS X 
Setup.hs view
@@ -104,6 +104,7 @@ createVteVersionCPPOpts vers =   catMaybes     [ if vers >= mkVersion [0,44] then Just "-DVTE_VERSION_GEQ_0_44" else Nothing+    , if vers >= mkVersion [0,63] then Just "-DVTE_VERSION_GEQ_0_63" else Nothing     ]  -- | Based on the version of the GTK3 library as reported by @pkg-config@, return
+ example-config/ExampleOneDarkProColourExtension.hs view
@@ -0,0 +1,114 @@+{-# LANGUAGE OverloadedStrings #-}+-- | This is an example Termonad configuration that shows how to use the+-- One Dark Pro colour scheme https://binaryify.github.io/OneDark-Pro/+-- +-- See an example in @../img/termonad-One_Dark_Pro.png@.++module Main where++import Data.Maybe (fromMaybe)+import Termonad+  ( CursorBlinkMode(CursorBlinkModeOn)+  , Option(Set)+  , ShowScrollbar(ShowScrollbarNever)+  , TMConfig+  , confirmExit+  , cursorBlinkMode+  , defaultConfigOptions+  , defaultTMConfig+  , options+  , showMenu+  , showScrollbar+  , start+  , FontConfig+  , FontSize(FontSizePoints)+  , defaultFontConfig+  , fontConfig+  , fontFamily+  , fontSize+  )+import Termonad.Config.Colour+  ( AlphaColour+  , ColourConfig+  , Palette(ExtendedPalette)+  , addColourExtension+  , createColour+  , createColourExtension+  , defaultColourConfig+  , defaultStandardColours+  , defaultLightColours+  , backgroundColour+  , foregroundColour+  , palette+  , List8+  , mkList8+  )++-- This is our main 'TMConfig'.  It holds all of the non-colour settings+-- for Termonad.+--+-- This shows how a few settings can be changed.+myTMConfig :: TMConfig+myTMConfig =+  defaultTMConfig+    { options =+        defaultConfigOptions+          { showScrollbar = ShowScrollbarNever+          , confirmExit = False+          , showMenu = False+          , cursorBlinkMode = CursorBlinkModeOn+          , fontConfig = fontConf+          }+    }++-- This is our Dracula 'ColourConfig'.+onedarkpro :: ColourConfig (AlphaColour Double)+onedarkpro =+  defaultColourConfig+    -- Set the default background & foreground colour of text of the terminal.+    { backgroundColour = Set (createColour  40  44  52)  -- black.0+    , foregroundColour = Set (createColour 171 178 191)  -- white.7+    -- Set the extended palette that has 2 Vecs of 8 Dracula palette colours+    , palette = ExtendedPalette onedarkproNormal onedarkproBright+    }+  where+    onedarkproNormal :: List8 (AlphaColour Double)+    onedarkproNormal = fromMaybe defaultStandardColours $ mkList8+      [ createColour  40  44  52 -- black.0+      , createColour 244 108 117 -- red.1+      , createColour 152 195 121 -- green.2+      , createColour 229 192 123 -- yellow.3+      , createColour  97 175 239 -- blue.4+      , createColour 198 120 221 -- magenta.5+      , createColour  86 182 194 -- cyan.6+      , createColour 171 178 191 -- white.7+      ]++    onedarkproBright :: List8 (AlphaColour Double)+    onedarkproBright = fromMaybe defaultStandardColours $ mkList8+      [ createColour  63  63  63 -- black.8+      , createColour 224 108 117 -- red.9+      , createColour 152 195 121 -- green.10+      , createColour 229 192 123 -- yellow.11+      , createColour  97 175 239 -- blue.12+      , createColour 198 120 221 -- magenta.13+      , createColour  86 182 194 -- cyan.14+      , createColour 191 197 206 -- white.15+      ]++fontConf =+  defaultFontConfig+    { fontFamily = "Monospace"+    , fontSize = FontSizePoints 12+    }++main :: IO ()+main = do+  -- First, create the colour extension based on either PaperColor modules.+  myColourExt <- createColourExtension onedarkpro++  -- Update 'myTMConfig' with our colour extension.+  let newTMConfig = addColourExtension myTMConfig myColourExt++  -- Start Termonad with our updated 'TMConfig'.+  start newTMConfig
flake.lock view
@@ -2,16 +2,16 @@   "nodes": {     "nixpkgs": {       "locked": {-        "lastModified": 1645575067,-        "narHash": "sha256-GoJYyj6eYv+NYODMj5ZHiunuRfj5dHsxBPafhjdZkDc=",+        "lastModified": 1665732960,+        "narHash": "sha256-WBZ+uSHKFyjvd0w4inbm0cNExYTn8lpYFcHEes8tmec=",         "owner": "NixOS",         "repo": "nixpkgs",-        "rev": "2b5c8147f5889b57f16de48015e18381ee65f63a",+        "rev": "4428e23312933a196724da2df7ab78eb5e67a88e",         "type": "github"       },       "original": {         "owner": "NixOS",-        "ref": "haskell-updates",+        "ref": "nixos-unstable",         "repo": "nixpkgs",         "type": "github"       }
flake.nix view
@@ -2,14 +2,7 @@   description = "A VTE-based terminal emulator configurable in Haskell";    # Nixpkgs / NixOS version to use.-  #-  # TODO: Nixpkgs is switching to use GHC-9.0.2 as the default compiler as of-  # 2022-02-21, but the switch has currently only happened on the-  # haskell-updates branch.  This temporarily makes Termonad use that branch.-  # When https://github.com/NixOS/nixpkgs/pull/160733 is merged into master,-  # switch back to nixos-unstable.-  inputs.nixpkgs.url = "github:NixOS/nixpkgs/haskell-updates";-  # inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";+  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";    outputs = { self, nixpkgs }:     let
glade/preferences.glade view
@@ -266,6 +266,21 @@               </packing>             </child>             <child>+              <object class="GtkCheckButton" id="enableSixel">+                <property name="label" translatable="yes">Enable sixel</property>+                <property name="visible">True</property>+                <property name="can-focus">True</property>+                <property name="receives-default">False</property>+                <property name="tooltip-text" translatable="yes">Enable sixel to draw graphics</property>+                <property name="halign">start</property>+                <property name="draw-indicator">True</property>+              </object>+              <packing>+                <property name="left-attach">1</property>+                <property name="top-attach">10</property>+              </packing>+            </child>+            <child>               <placeholder/>             </child>             <child>
src/Termonad/App.hs view
@@ -125,10 +125,11 @@ import System.FilePath (takeFileName)  import Paths_termonad (getDataFileName)-import Termonad.Gtk (appNew, objFromBuildUnsafe)+import Termonad.Gtk (appNew, objFromBuildUnsafe, terminalSetEnableSixelIfExists) import Termonad.Keys (handleKeyPress) import Termonad.Lenses   ( lensBoldIsBright+  , lensEnableSixel   , lensConfirmExit   , lensCursorBlinkMode   , lensFontConfig@@ -727,6 +728,7 @@   terminalSetWordCharExceptions term (wordCharExceptions options)   terminalSetScrollbackLines term (fromIntegral (scrollbackLen options))   terminalSetBoldIsBright term (boldIsBright options)+  terminalSetEnableSixelIfExists term (enableSixel options)    let vScrollbarPolicy = showScrollbarToPolicy (options ^. lensShowScrollbar)   scrolledWindowSetPolicy scrolledWin PolicyTypeAutomatic vScrollbarPolicy@@ -752,6 +754,8 @@     objFromBuildUnsafe preferencesBuilder "showMenu" CheckButton   boldIsBrightCheckButton <-     objFromBuildUnsafe preferencesBuilder "boldIsBright" CheckButton+  enableSixelCheckButton <-+    objFromBuildUnsafe preferencesBuilder "enableSixel" CheckButton   wordCharExceptionsEntryBuffer <-     objFromBuildUnsafe preferencesBuilder "wordCharExceptions" Entry >>=       getEntryBuffer@@ -806,6 +810,7 @@   toggleButtonSetActive confirmExitCheckButton $ confirmExit options   toggleButtonSetActive showMenuCheckButton $ showMenu options   toggleButtonSetActive boldIsBrightCheckButton $ boldIsBright options+  toggleButtonSetActive enableSixelCheckButton $ enableSixel options   entryBufferSetText wordCharExceptionsEntryBuffer (wordCharExceptions options) (-1)    -- Run dialog then close@@ -827,6 +832,7 @@     confirmExitVal <- toggleButtonGetActive confirmExitCheckButton     showMenuVal <- toggleButtonGetActive showMenuCheckButton     boldIsBrightVal <- toggleButtonGetActive boldIsBrightCheckButton+    enableSixelVal <- toggleButtonGetActive enableSixelCheckButton     wordCharExceptionsVal <- entryBufferGetText wordCharExceptionsEntryBuffer      -- Apply the changes to mvarTMState@@ -836,6 +842,7 @@         ( set lensConfirmExit confirmExitVal         . set lensShowMenu showMenuVal         . set lensBoldIsBright boldIsBrightVal+        . set lensEnableSixel enableSixelVal         . set lensWordCharExceptions wordCharExceptionsVal         . over lensFontConfig (`fromMaybe` maybeFontConfig)         . set lensScrollbackLen scrollbackLenVal
src/Termonad/Gtk.hs view
@@ -1,3 +1,18 @@+{-# LANGUAGE CPP #-}++-- | This module contains two things:+--+-- 1. Extension functions to libraries like GTK.  These functions wrap up some+--    generic GTK functionality.  They are not Termonad-specific.+--+-- 2. Wrappers around functionality that is only specific to certain versions+--    of libraries like GTK or VTE.+--+--    For instance, 'terminalSetEnableSixelIfExists' is+--    a wrapper around 'terminalSetEnableSixel'.  Sixel support is only availble in+--    vte >= 0.63, so if a user tries to compile Termonad with a version of vte+--    less than 0.63, this function won't do anything.+ module Termonad.Gtk where  import Termonad.Prelude@@ -12,6 +27,12 @@ import GI.Gio (ApplicationFlags) import GI.Gtk (Application, IsWidget, Widget(Widget), applicationNew, builderGetObject, toWidget) import qualified GI.Gtk as Gtk+import GI.Vte+  ( IsTerminal+#ifdef VTE_VERSION_GEQ_0_63+  , terminalSetEnableSixel+#endif+  )   objFromBuildUnsafe ::@@ -58,3 +79,17 @@     withManagedPtr managedPtrA $ \ptrA ->       withManagedPtr managedPtrB $ \ptrB ->         pure (ptrA == ptrB)++-- | Wrapper around 'terminalSetEnableSixel'.  The 'terminalSetEnableSixel' function+-- is only available starting with vte-0.63. This function has no effect when+-- compiling against previous versions of vte.+terminalSetEnableSixelIfExists+  :: (HasCallStack, MonadIO m, IsTerminal t)+  => t -- ^ a Terminal+  -> Bool -- ^ whether to enable SIXEL images+  -> m ()+terminalSetEnableSixelIfExists t b = do+#ifdef VTE_VERSION_GEQ_0_63+  terminalSetEnableSixel t b+#endif+  pure ()
src/Termonad/Lenses.hs view
@@ -59,6 +59,7 @@     , ("showTabBar", "lensShowTabBar")     , ("cursorBlinkMode", "lensCursorBlinkMode")     , ("boldIsBright", "lensBoldIsBright")+    , ("enableSixel", "lensEnableSixel")     ]     ''ConfigOptions  )
src/Termonad/Term.hs view
@@ -88,16 +88,17 @@   , onTerminalWindowTitleChanged   , terminalGetWindowTitle   , terminalNew+  , terminalSetBoldIsBright   , terminalSetCursorBlinkMode   , terminalSetFont   , terminalSetScrollbackLines-  , terminalSpawnSync   , terminalSetWordCharExceptions-  , terminalSetBoldIsBright+  , terminalSpawnSync   ) import System.Directory (getSymbolicLinkTarget) import System.Environment (lookupEnv) +import Termonad.Gtk (terminalSetEnableSixelIfExists) import Termonad.Lenses   ( lensConfirmExit   , lensOptions@@ -114,7 +115,7 @@   ) import Termonad.Types   ( ConfigHooks(createTermHook)-  , ConfigOptions(scrollbackLen, wordCharExceptions, cursorBlinkMode, boldIsBright)+  , ConfigOptions(scrollbackLen, wordCharExceptions, cursorBlinkMode, boldIsBright, enableSixel)   , ShowScrollbar(..)   , ShowTabBar(..)   , TMConfig(hooks, options)@@ -360,6 +361,7 @@   terminalSetScrollbackLines vteTerm (fromIntegral (scrollbackLen curOpts))   terminalSetCursorBlinkMode vteTerm (cursorBlinkMode curOpts)   terminalSetBoldIsBright vteTerm (boldIsBright curOpts)+  terminalSetEnableSixelIfExists vteTerm (enableSixel curOpts)   widgetShow vteTerm   pure vteTerm 
src/Termonad/Types.hs view
@@ -408,6 +408,11 @@     -- If 'False', then bold can be applied separately to colors from both the     -- 'Termonad.Config.Colour.BasicPalatte' and     -- 'Termonad.Config.Colour.ExtendedPalatte'.+  , enableSixel :: !Bool+    -- ^ Enable SIXEL to draw graphics in a terminal.+    --+    -- Note that SIXEL may not be fully supported in VTE. Follow+    -- <https://gitlab.gnome.org/GNOME/vte/-/issues/253> for more information.   } deriving (Eq, Generic, FromJSON, Show, ToJSON)  instance FromJSON CursorBlinkMode where@@ -439,6 +444,7 @@ --           , showTabBar = ShowTabBarIfNeeded --           , cursorBlinkMode = CursorBlinkModeOn --           , boldIsBright = False+--           , enableSixel = False --           } --   in defaultConfigOptions == defConfOpt -- :}@@ -455,6 +461,7 @@     , showTabBar = ShowTabBarIfNeeded     , cursorBlinkMode = CursorBlinkModeOn     , boldIsBright = False+    , enableSixel = False     }  -- | The Termonad 'ConfigOptions' along with the 'ConfigHooks'.
termonad.cabal view
@@ -1,5 +1,5 @@ name:                termonad-version:             4.2.0.1+version:             4.3.0.0 synopsis:            Terminal emulator configurable in Haskell description:   Termonad is a terminal emulator configurable in Haskell.  It is extremely@@ -247,6 +247,19 @@   else     buildable:         False +executable termonad-example-colour-extension-oneDarkPro+  main-is:             example-config/ExampleOneDarkProColourExtension.hs+  build-depends:       base+                     , termonad+                     , colour+  default-language:    Haskell2010+  ghc-options:         -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates -threaded -rtsopts -with-rtsopts=-N++  if flag(buildexamples)+    buildable:         True+  else+    buildable:         False+ executable termonad-example-colour-extension-papercolour   main-is:             example-config/ExamplePaperColourColourExtension.hs   build-depends:       base@@ -272,20 +285,6 @@     buildable:         True   else     buildable:         False--source-repository head-  type:     git-  location: https://github.com/cdepillabout/termonad/---- benchmark termonad-bench---   type:                exitcode-stdio-1.0---   main-is:             Bench.hs---   hs-source-dirs:      bench---   build-depends:       base---                      , criterion---                      , termonad---   default-language:    Haskell2010---   ghc-options:         -Wall -threaded -rtsopts -with-rtsopts=-N  source-repository head   type:     git
test/readme/README.lhs view
@@ -118,31 +118,49 @@  ### Nix -If you have `nix` installed, you should be able to use it to build Termonad.+If you have `nix` installed, you should be able to use it to obtain Termonad. This means that it will work on NixOS, or with `nix` on another distro.  There-are two different ways to use `nix` to build Termonad:+are three different ways to use `nix` to get Termonad: -The first is using `stack`.  The following commands install `stack` for your-user, clone this repository, and install the `termonad` binary to `~/.local/bin/`:+1.  Get Termonad from Nixpkgs.  Termonad is provided as a top-level `termonad`+    attribute in Nixpkgs. -```sh-$ nix-env -i stack-$ git clone https://github.com/cdepillabout/termonad-$ cd termonad/-$ stack --nix install-```+    For instance, run a `nix-shell` with Termonad: -(_edit_: Building with `stack` using Nix-integration does not currently work.-See [#99](https://github.com/cdepillabout/termonad/issues/99).)+    ```console+    $ nix-shell -p termonad+    $ termonad   # run termonad within the nix-shell+    ``` -The second is using the normal `nix-build` machinery.  The following commands-clone this repository and build the `termonad` binary at `./result/bin/`:+    You can also install `termonad` with tools like `nix-env` or home-manager.+    If you're using NixOS, you can add `termonad` to your+    `environment.systemPackages` list. -```sh-$ git clone https://github.com/cdepillabout/termonad-$ cd termonad/-$ nix-build-```+    Keep in mind that if you're using an old release of NixOS, you'll likely+    get an older version of Termonad.++2.  Build Termonad using the code in this repository. The following commands+    clone this repo and build the `termonad` binary at `./result/bin/`:++    ```sh+    $ git clone https://github.com/cdepillabout/termonad+    $ cd termonad/+    $ nix-build+    ```++3.  Build Termonad using `stack` with Nix-integration. The following commands+    install `stack` for your user, clone this repository, and install the+    `termonad` binary to `~/.local/bin/`:++    ```sh+    $ nix-env -i stack+    $ git clone https://github.com/cdepillabout/termonad+    $ cd termonad/+    $ stack --nix install+    ```++    (_edit_: Building with `stack` using Nix-integration does not currently work.+    See [#99](https://github.com/cdepillabout/termonad/issues/99).)  ### Mac OS X