Commit 2505405e authored by Valentin Reis's avatar Valentin Reis
Browse files

adds grafting option.

parent 33e02df1
Pipeline #5476 passed with stage
in 3 minutes and 9 seconds
......@@ -95,12 +95,14 @@ main = do
)
data ArgsCommon = ArgsCommon
{ argopkgs :: Text
, verbosity :: Verbosity
, run :: Maybe Text
, overrides :: [(String, String)]
{ argopkgs :: Text
, verbosity :: Verbosity
, run :: Maybe Text
, overrides :: [(String, String)]
, grafting :: Grafting
} deriving (Show)
data Verbosity = Verbose | Normal deriving (Show, Eq)
data Grafting = Libnrm | NoGraft deriving (Show, Eq)
data ArgsRemote = ArgsRemote
{ targetMachine
......@@ -113,7 +115,8 @@ instance Default ArgsCommon where
{ verbosity = Normal,
argopkgs = "<argopkgs>",
run = Nothing,
overrides = []
overrides = [],
grafting = NoGraft
}
instance Default ArgsRemote where
......@@ -157,6 +160,12 @@ commonParser = do
Normal
Verbose
(long "verbose" <> short 'v' <> help "Enable verbose mode")
grafting <- flag
NoGraft
Libnrm
(long "grafting" <> short 'g' <> help
"Enable libnrm grafting to avoid rebuilding applications."
)
overrides <- catMaybes <$> targets
run <- optional $ strOption
(long "run" <> metavar "COMMAND" <> help
......@@ -256,8 +265,10 @@ setupSystem sa = do
void $ printInfo "Done setting the environment for nix-build up."
nixArguments :: String -> ArgsCommon -> [String]
nixArguments target ArgsCommon {..} = [unpack argopkgs, "-A", target]
++ concat [ ["--arg", longform <> "-src", p] | (longform, p) <- overrides ]
nixArguments target ArgsCommon {..} =
[unpack argopkgs, "-A", target]
++ concat [ ["--arg", longform <> "-src", p] | (longform, p) <- overrides ]
++ (if grafting == Libnrm then [] else ["--arg", "rebuildApps", "false"])
data NixCommand = NixBuild | NixShell
toCommand :: IsString p => NixCommand -> p
......@@ -293,8 +304,7 @@ wrap nixCommand target sa@ArgsCommon {..} = sh $ do
]
remotely :: String -> ArgsCommon -> ArgsRemote -> IO ()
remotely _ _ _ =
putStrLn "unsupported in this version"
remotely _ _ _ = putStrLn "unsupported in this version"
{-nixshell :: IO ()-}
{-nixshell = undefined-}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment