From 2463531612bc9cc1e499f5232f27ffd3fc8def57 Mon Sep 17 00:00:00 2001 From: Hugo McNally Date: Fri, 30 Aug 2024 22:00:55 +0100 Subject: [PATCH] Set up a sonata software mdBook --- SUMMARY.md | 11 +++++++++++ book.toml | 9 +++++++++ flake.nix | 25 ++++++++++++++++++------- 3 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 SUMMARY.md create mode 100644 book.toml diff --git a/SUMMARY.md b/SUMMARY.md new file mode 100644 index 0000000..0a178de --- /dev/null +++ b/SUMMARY.md @@ -0,0 +1,11 @@ +# Sonata Software + +[Introduction](./README.md) + +- [Getting started](./doc/getting-started.md) + - [Running Sonata Software](./doc/guide/running-software.md) + +- [Exploring the CHERIoT RTOS](./doc/exploring-cheriot-rtos.md) + +- [Exercises](./exercises/README.md) + - [Hardware Access Control Exercise](./exercises/hardware_access_control/README.md) diff --git a/book.toml b/book.toml new file mode 100644 index 0000000..4dc842c --- /dev/null +++ b/book.toml @@ -0,0 +1,9 @@ +[book] +language = "en" +multilingual = false +src = "." +title = "Sonata Software" + +[output.html] +git-repository-url = "https://github.com/lowRISC/sonata-software" +edit-url-template = "https://github.com/lowRISC/sonata-software/edit/main/{path}" diff --git a/flake.nix b/flake.nix index 099cc2d..e8312fa 100644 --- a/flake.nix +++ b/flake.nix @@ -22,13 +22,15 @@ sonata-system, }: let system_outputs = system: let + version = "0.0.1"; + pkgs = import nixpkgs {inherit system;}; lrPkgs = lowrisc-nix.outputs.packages.${system}; + lrDoc = lowrisc-nix.lib.doc {inherit pkgs;}; sonataSystemPkgs = sonata-system.outputs.packages.${system}; cheriotPkgs = lowrisc-nix.outputs.devShells.${system}.cheriot.nativeBuildInputs; - fs = pkgs.lib.fileset; - getExe = pkgs.lib.getExe; + inherit (pkgs.lib) fileset getExe; commonSoftwareBuildAttributes = { buildInputs = cheriotPkgs ++ [lrPkgs.uf2conv]; @@ -39,11 +41,20 @@ dontFixup = true; }; + sonata-software-documentation = lrDoc.buildMdbookSite { + inherit version; + pname = "sonata-software-documentation"; + src = fileset.toSource { + root = ./.; + fileset = lrDoc.standardMdbookFileset ./.; + }; + }; + sonata-tests = pkgs.stdenvNoCC.mkDerivation ({ name = "sonata-tests"; - src = fs.toSource { + src = fileset.toSource { root = ./.; - fileset = fs.unions [./tests ./common.lua ./cheriot-rtos]; + fileset = fileset.unions [./tests ./common.lua ./cheriot-rtos]; }; buildPhase = "xmake -P ./tests/"; } @@ -51,9 +62,9 @@ sonata-examples = pkgs.stdenvNoCC.mkDerivation ({ name = "sonata-examples"; - src = fs.toSource { + src = fileset.toSource { root = ./.; - fileset = fs.unions [ + fileset = fileset.unions [ ./common.lua ./cheriot-rtos ./libraries @@ -174,7 +185,7 @@ SONATA_SIM_BOOT_STUB = "${sonataSystemPkgs.sonata-sim-boot-stub.out}/share/sim_boot_stub"; }; }; - packages = {inherit sonata-examples sonata-tests;}; + packages = {inherit sonata-examples sonata-tests sonata-software-documentation;}; checks = {inherit tests-simulator;}; apps = builtins.listToAttrs (map (program: { inherit (program) name;