mirror of
https://github.com/nmattia/snack.git
synced 2024-11-28 03:45:45 +03:00
Use max-jobs instead of cores
This commit is contained in:
parent
51c56ad3a3
commit
b857a4903c
@ -82,7 +82,7 @@ The _snack_ executable is now in your `PATH`:
|
||||
``` shell
|
||||
$ snack --help
|
||||
Usage: <interactive> [-l|--lib DIR] ([-s|--snack-nix PATH] | [--no-snack-nix])
|
||||
[-j|--cores INT] [-p|--package-file PATH] (COMMAND |
|
||||
[-j|--jobs INT] [-p|--package-file PATH] (COMMAND |
|
||||
COMMAND)
|
||||
|
||||
Available options:
|
||||
@ -94,7 +94,7 @@ Available options:
|
||||
(Use --no-snack-nix to disable this behavior)
|
||||
--no-snack-nix Don't use ./snack.nix as the environment (snack.nix)
|
||||
file.
|
||||
-j,--cores INT How many cores to use during the build
|
||||
-j,--jobs INT How many jobs to run concurrently
|
||||
-p,--package-file PATH Specifies a YAML or Nix file to use as package
|
||||
description. If not provided, snack looks for either
|
||||
'package.yaml' or 'package.nix' in the current
|
||||
|
10
bin/Snack.hs
10
bin/Snack.hs
@ -171,17 +171,17 @@ discoverPackageFile = do
|
||||
|
||||
-- | How to call @nix-build@
|
||||
newtype NixConfig = NixConfig
|
||||
{ nixNCores :: Int }
|
||||
{ nixNJobs :: Int }
|
||||
|
||||
parseNixConfig :: Opts.Parser NixConfig
|
||||
parseNixConfig =
|
||||
(NixConfig <$>
|
||||
Opts.option Opts.auto
|
||||
(Opts.long "cores"
|
||||
(Opts.long "jobs"
|
||||
<> Opts.short 'j'
|
||||
<> Opts.value 1
|
||||
<> Opts.metavar "INT"
|
||||
<> Opts.help "How many cores to use during the build")
|
||||
<> Opts.help "How many jobs to run concurrently")
|
||||
)
|
||||
|
||||
--- Snack configuration (unrelated to packages)
|
||||
@ -390,8 +390,8 @@ nixBuild snackCfg extraNixArgs nixExpr =
|
||||
cliArgs =
|
||||
[ "-" -- read expression from stdin
|
||||
, "--no-out-link" -- no need for roots
|
||||
-- how many cores to use (-j)
|
||||
, "--cores", T.pack (show (nixNCores nixCfg))
|
||||
-- how many jobs to run concurrently (-j)
|
||||
, "--max-jobs", T.pack (show (nixNJobs nixCfg))
|
||||
] <> (concatMap toCliArgs nixArgs)
|
||||
funArgs :: [String]
|
||||
funArgs = toFunArg <$> nixArgs
|
||||
|
Loading…
Reference in New Issue
Block a user