Skip to content

Commit

Permalink
Set up a sonata software mdBook
Browse files Browse the repository at this point in the history
  • Loading branch information
HU90m committed Aug 30, 2024
1 parent 64ffcfc commit 2463531
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 7 deletions.
11 changes: 11 additions & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
@@ -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)
9 changes: 9 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
@@ -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}"
25 changes: 18 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -39,21 +41,30 @@
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/";
}
// commonSoftwareBuildAttributes);

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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 2463531

Please sign in to comment.