aboutsummaryrefslogtreecommitdiffhomepage
path: root/default.nix
diff options
context:
space:
mode:
authorGravatar Théo Zimmermann <theo.zimmermann@univ-paris-diderot.fr>2018-07-03 13:43:02 +0200
committerGravatar Théo Zimmermann <theo.zimmermann@univ-paris-diderot.fr>2018-07-03 23:57:56 +0200
commit81c3b2003d3d9b1492949773ed69e0c0ddac8316 (patch)
tree1018a1e3dcda39e6eb47a757ed0fdfe3fdb90b36 /default.nix
parent5239af30618d3c23666cc75078bf269172b6d3df (diff)
Refactor default.nix to use optionals.
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix46
1 files changed, 14 insertions, 32 deletions
diff --git a/default.nix b/default.nix
index 2bf0409d6..1be274081 100644
--- a/default.nix
+++ b/default.nix
@@ -42,51 +42,33 @@ stdenv.mkDerivation rec {
buildInputs = [
hostname
python2 time # coq-makefile timing tools
-
- ] ++ (with ocamlPackages; [
- ocaml
- findlib
- camlp5_strict
- num
-
- ]) ++ (if buildIde then [
-
- # CoqIDE dependencies
- ocamlPackages.lablgtk
-
- ] else []) ++ (if buildDoc then [
-
+ ]
+ ++ (with ocamlPackages; [ ocaml findlib camlp5_strict num ])
+ ++ optional buildIde ocamlPackages.lablgtk
+ ++ optionals buildDoc [
# Sphinx doc dependencies
pkgconfig (python3.withPackages
(ps: [ ps.sphinx ps.sphinx_rtd_theme ps.pexpect ps.beautifulsoup4
ps.antlr4-python3-runtime ps.sphinxcontrib-bibtex ]))
- antlr4
-
- ] else []) ++ (if doInstallCheck then
-
+ antlr4
+ ]
+ ++ optionals doInstallCheck (
# Test-suite dependencies
# ncurses is required to build an OCaml REPL
optional (!versionAtLeast ocaml.version "4.07") ncurses
++ [ ocamlPackages.ounit rsync which ]
-
- else []) ++ (if lib.inNixShell then [
- ocamlPackages.merlin
- ocamlPackages.ocp-indent
- ocamlPackages.ocp-index
-
- # Dependencies of the merging script
- jq
- curl
- git
- gnupg
-
- ] else []);
+ )
+ ++ optionals lib.inNixShell (
+ [ jq curl git gnupg ] # Dependencies of the merging script
+ ++ (with ocamlPackages; [ merlin ocp-indent ocp-index ]) # Dev tools
+ );
src =
if lib.inNixShell then null
else
with builtins; filterSource
- (path: _: !elem (baseNameOf path) [".git" "result" "bin"]) ./.;
+ (path: _:
+ !elem (baseNameOf path) [".git" "result" "bin" "_build_ci"]) ./.;
prefixKey = "-prefix ";