diff --git a/docs/.gitignore b/docs/.gitignore index 5192fc642..07d1f16a1 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -1,3 +1,4 @@ /site/reference /site/static +/site/options-page !/site/static/extra.css diff --git a/docs/nix/default.nix b/docs/nix/default.nix index 2f62debce..474c72ae1 100644 --- a/docs/nix/default.nix +++ b/docs/nix/default.nix @@ -36,6 +36,11 @@ pkgs.stdenv.mkDerivation { mkdir -p ./site/reference/cli cp -af ${module-docs}/* ./site/reference/ cp -af ${clan-cli-docs}/* ./site/reference/cli/ + chmod -R +w ./site/reference + echo "Generated API documentation in './site/reference/' " + + cp -r ${docs-options} ./site/options-page + chmod -R +w ./site/options-page mkdir -p ./site/static/asciinema-player ln -snf ${asciinema-player-js} ./site/static/asciinema-player/asciinema-player.min.js @@ -56,6 +61,5 @@ pkgs.stdenv.mkDerivation { installPhase = '' cp -a out/ $out/ - cp -r ${docs-options} $out/options-page ''; } diff --git a/docs/nix/flake-module.nix b/docs/nix/flake-module.nix index 815653dd3..37fe01565 100644 --- a/docs/nix/flake-module.nix +++ b/docs/nix/flake-module.nix @@ -115,15 +115,16 @@ clanModulesViaService ; }; - devShells.docs = pkgs.callPackage ./shell.nix { - inherit (self'.packages) docs clan-cli-docs inventory-api-docs; - inherit - asciinema-player-js - asciinema-player-css - module-docs - self' - ; - }; + devShells.docs = self'.packages.docs.overrideAttrs (_old: { + nativeBuildInputs = + self'.devShells.default.nativeBuildInputs ++ self'.packages.docs.nativeBuildInputs; + shellHook = '' + ${self'.devShells.default.shellHook} + git_root=$(git rev-parse --show-toplevel) + cd "$git_root" + runPhase configurePhase + ''; + }); packages = { docs = pkgs.python3.pkgs.callPackage ./default.nix { clan-core = self; diff --git a/docs/nix/shell.nix b/docs/nix/shell.nix deleted file mode 100644 index 180d53b08..000000000 --- a/docs/nix/shell.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ - docs, - pkgs, - module-docs, - clan-cli-docs, - asciinema-player-js, - asciinema-player-css, - roboto, - fira-code, - self', - ... -}: -pkgs.mkShell { - name = "clan-docs"; - inputsFrom = [ - docs - self'.devShells.default - ]; - shellHook = '' - git_root=$(git rev-parse --show-toplevel) - cd ''${git_root}/docs - - mkdir -p ./site/reference/cli - cp -af ${module-docs}/* ./site/reference/ - cp -af ${clan-cli-docs}/* ./site/reference/cli/ - - chmod -R +w ./site/reference/* - - echo "Generated API documentation in './site/reference/' " - - mkdir -p ./site/static/asciinema-player - - ln -snf ${asciinema-player-js} ./site/static/asciinema-player/asciinema-player.min.js - ln -snf ${asciinema-player-css} ./site/static/asciinema-player/asciinema-player.css - - # Link to fonts - ln -snf ${roboto}/share/fonts/truetype/Roboto-Regular.ttf ./site/static/ - ln -snf ${fira-code}/share/fonts/truetype/FiraCode-VF.ttf ./site/static/ - ''; -}