-
Notifications
You must be signed in to change notification settings - Fork 16
/
Config.hs
47 lines (44 loc) · 1.23 KB
/
Config.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
-- | Copyright: (c) 2021-2022 berberman
-- SPDX-License-Identifier: MIT
-- Maintainer: berberman <berberman@yandex.com>
-- Stability: experimental
-- Portability: portable
module NvFetcher.Config where
import Data.Default
import Development.Shake
-- | Nvfetcher configuration
data Config = Config
{ shakeConfig :: ShakeOptions,
buildDir :: FilePath,
customRules :: Rules (),
actionAfterBuild :: Action (),
actionAfterClean :: Action (),
retry :: Int,
filterRegex :: Maybe String,
cacheNvchecker :: Bool,
keepOldFiles :: Bool,
-- | Absolute path
keyfile :: Maybe FilePath,
-- | When set to 'True', nvfetcher will keep going even if some packages failed to /fetch/
keepGoing :: Bool
}
instance Default Config where
def =
Config
{ shakeConfig =
shakeOptions
{ shakeProgress = progressSimple,
shakeThreads = 0,
shakeVersion = "1"
},
buildDir = "_sources",
customRules = pure (),
actionAfterBuild = pure (),
actionAfterClean = pure (),
retry = 3,
filterRegex = Nothing,
cacheNvchecker = True,
keepOldFiles = False,
keyfile = Nothing,
keepGoing = False
}