Skip to content

Commit ada4dad

Browse files
committed
Be able to pass config args to default.nix
1 parent 2ed7201 commit ada4dad

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

templates/default.nix

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
1-
{ pkgs ? import <nixpkgs> {} }:
1+
{ pkgs ? import <nixpkgs> {}
22

3-
with pkgs;
3+
# The base Julia version
4+
, baseJulia ? pkgs.julia-stable-bin
45

6+
# Extra libraries for Julia's LD_LIBRARY_PATH.
7+
# Recent Julia packages that use Artifacts.toml to specify their dependencies
8+
# shouldn't need this.
9+
# But if a package implicitly depends on some library being present at runtime, you can
10+
# add it here.
11+
, extraLibs ? []
512

6-
let
7-
# The base Julia version
8-
baseJulia = julia-lts-bin;
13+
, python ? pkgs.python3
14+
}:
915

10-
# Extra libraries for Julia's LD_LIBRARY_PATH.
11-
# Recent Julia packages that use Artifacts.toml to specify their dependencies
12-
# shouldn't need this.
13-
# But if a package implicitly depends on some library being present at runtime, you can
14-
# add it here.
15-
extraLibs = [];
16+
with pkgs;
1617

18+
19+
let
1720
# Wrapped Julia with libraries and environment variables.
1821
# Note: setting The PYTHON environment variable is recommended to prevent packages
1922
# from trying to obtain their own with Conda.
2023
julia = runCommand "julia-wrapped" { buildInputs = [makeWrapper]; } ''
2124
mkdir -p $out/bin
2225
makeWrapper ${baseJulia}/bin/julia $out/bin/julia \
2326
--suffix LD_LIBRARY_PATH : "${lib.makeLibraryPath extraLibs}" \
24-
--set PYTHON ${python3}/bin/python
27+
--set PYTHON ${python}/bin/python
2528
'';
2629

2730
in

0 commit comments

Comments
 (0)