-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConf.hs
49 lines (44 loc) · 1.2 KB
/
Conf.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{-# LANGUAGE DeriveDataTypeable #-}
module Conf
( Nixrbd(..)
, parseOpts
) where
import System.Console.CmdArgs hiding (def)
data Nixrbd = Nixrbd
{ nixrbdPort :: Int
, nixrbdConfigFile :: FilePath
, nixrbdNixPath :: [String]
, nixrbdBehindProxy :: Bool
, nixrbdRoutes :: [(String,String)]
, nixrbdBuildDir :: FilePath
} deriving (Show, Data, Typeable)
parseOpts :: IO Nixrbd
parseOpts = cmdArgs nixrbdDefs
nixrbdDefs :: Nixrbd
nixrbdDefs = Nixrbd
{ nixrbdPort = 8000
&= explicit
&= name "p" &= name "port"
&= help "TCP port to bind to"
, nixrbdConfigFile = ""
&= explicit
&= typFile
&= name "c" &= name "configfile"
&= help "Path to configuration file"
, nixrbdNixPath = []
&= explicit
&= name "I"
&= help "Add a path used by nix-build"
, nixrbdBehindProxy = False
&= explicit
&= name "b" &= name "proxied"
&= help "Wether nixrbd is running behind a proxy or not"
, nixrbdRoutes = []
&= explicit
&= name "r" &= name "route"
&= help "Add a route"
, nixrbdBuildDir = ""
&= explicit
&= name "d" &= name "builddir"
&= help "Directory to store build result symlinks in"
} &= summary "Nix Remote Boot Daemon v0.1.1"