Skip to content

Commit

Permalink
Mention how to make turtle scripts runnable using Nix (#373)
Browse files Browse the repository at this point in the history
Fixes #371
  • Loading branch information
Gabriella439 authored Jan 29, 2020
1 parent 746cc04 commit d148477
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/Turtle/Tutorial.hs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ module Turtle.Tutorial (
-- * Conclusion
-- $conclusion

-- * Nix scripts
-- $nix

-- * FAQ
-- $faq
) where
Expand Down Expand Up @@ -1796,6 +1799,31 @@ import Turtle
-- still benefit from adding more utilities for better parity with the Unix
-- ecosystem. Pull requests to add new utilities are highly welcome!

-- $nix
--
-- You can also turn `turtle` scripts into runnable scripts using Nix, like
-- this:
--
-- > #! /usr/bin/env nix-shell
-- > #! nix-shell -i runghc --packages "ghc.withPackages (x: [ x.turtle ])"
-- >
-- > {-# LANGUAGE OverloadedStrings #-}
-- >
-- > import Turtle
-- >
-- > main = echo "Hello, world!"
--
-- ... or create an auto-reloading script like this:
--
-- > #! /usr/bin/env nix-shell
-- > #! nix-shell -i "ghcid -T main" --packages ghcid "ghc.withPackages (x: [ x.turtle ])"
-- >
-- > {-# LANGUAGE OverloadedStrings #-}
-- >
-- > import Turtle
-- >
-- > main = echo "Hello, world!"

-- $faq
--
-- These are the most frequently asked questions from new users:
Expand Down Expand Up @@ -1853,3 +1881,4 @@ import Turtle
-- like this:
--
-- > Turtle.system (System.Process.proc "/bin/sh" []) empty

0 comments on commit d148477

Please sign in to comment.