Skip to content

Commit 8e2399d

Browse files
authored
Merge pull request #229 from sorki/srk/buildRemoteReadme
remote: build README.md via cabal
2 parents 03e4d0d + 5bad683 commit 8e2399d

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

hnix-store-remote/README.lhs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
README.md

hnix-store-remote/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,19 @@ via `nix-daemon`.
1212
## Example
1313

1414
```haskell
15+
{-# LANGUAGE OverloadedStrings #-}
1516

17+
import Control.Monad (void)
1618
import Control.Monad.IO.Class (liftIO)
17-
import Data.HashSet as HS
1819
import System.Nix.Store.Remote
1920

21+
main :: IO ()
2022
main = do
21-
runStore $ do
23+
void $ runStore $ do
2224
syncWithGC
2325
roots <- findRoots
2426
liftIO $ print roots
2527

26-
res <- addTextToStore "hnix-store" "test" (HS.fromList []) False
28+
res <- addTextToStore "hnix-store" "test" mempty False
2729
liftIO $ print res
2830
```

hnix-store-remote/hnix-store-remote.cabal

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ flag io-testsuite
2626
Enable testsuite, which requires external
2727
binaries and Linux namespace support.
2828

29+
flag build-readme
30+
default:
31+
True
32+
description:
33+
Build README.lhs example
34+
2935
library
3036
import: commons
3137
exposed-modules:
@@ -81,6 +87,16 @@ library
8187
default-language: Haskell2010
8288
ghc-options: -Wall
8389

90+
executable remote-readme
91+
build-depends:
92+
base >=4.12 && <5
93+
, hnix-store-remote
94+
build-tool-depends:
95+
markdown-unlit:markdown-unlit
96+
default-language: Haskell2010
97+
main-is: README.lhs
98+
ghc-options: -pgmL markdown-unlit -Wall
99+
84100
test-suite hnix-store-remote-tests
85101
import: commons
86102

0 commit comments

Comments
 (0)