Skip to content

Commit

Permalink
chore(nix): allow running make livedoc in the nix shell (ocaml#10348)
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Nuno Monteiro <[email protected]>
  • Loading branch information
anmonteiro authored Apr 1, 2024
1 parent 9e1c42e commit 4ec8b98
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
, duneFromScope ? false
}:
let
slimPkgs =
pkgs' =
if duneFromScope then
pkgs.extend
(self: super: {
Expand All @@ -99,23 +99,31 @@
})
else pkgs;

inherit (slimPkgs) writeScriptBin stdenv lib;
inherit (pkgs') writeScriptBin stdenv lib;

docInputs = with pkgs'.python3.pkgs; [
sphinx-autobuild
sphinx_rtd_theme
sphinx-copybutton
sphinx-design
];
duneScript =
writeScriptBin "dune" ''
#!${stdenv.shell}
"$DUNE_SOURCE_ROOT"/_boot/dune.exe $@
'';
in

slimPkgs.mkShell {
pkgs'.mkShell {
shellHook = ''
export DUNE_SOURCE_ROOT=$PWD
'';
inherit meta;
nativeBuildInputs = testNativeBuildInputs ++ [ duneScript ];
inputsFrom = [ slimPkgs.ocamlPackages.dune_3 ];
buildInputs = testBuildInputs ++ (with slimPkgs.ocamlPackages; [
nativeBuildInputs = testNativeBuildInputs
++ docInputs
++ [ duneScript ];
inputsFrom = [ pkgs'.ocamlPackages.dune_3 ];
buildInputs = testBuildInputs ++ (with pkgs'.ocamlPackages; [
merlin
ppx_expect
ctypes
Expand Down

0 comments on commit 4ec8b98

Please sign in to comment.