Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion docs/sourceos-shell-service-graph.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ These services are grouped by the `sourceos-shell.target` scaffold.

This target is a Linux realization placeholder that captures the expected runtime grouping before the actual product/runtime repo exists.

## Validation scaffold

The current Linux realization adds a dedicated contract-style check at:

- `tests/sourceos-shell-service-graph-contract.nix`

This check verifies that:

- `sourceos-shell.target` exists
- the four runtime scaffold services are grouped beneath that target
- the Nix module expresses the target and `partOf` relationships consistently

## Follow-on

Once `SourceOS-Linux/sourceos-shell` exists, the placeholder ExecStart values should be replaced with real package/service paths and the current scaffold checks should be upgraded into service-graph checks.
Once `SourceOS-Linux/sourceos-shell` exists, the placeholder ExecStart values should be replaced with real package/service paths and the current scaffold checks should be upgraded into actual runtime/service-graph checks.
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
'';

sourceos-shell-module-contract = import ./tests/sourceos-shell-module-contract.nix { inherit pkgs; };
sourceos-shell-service-graph-contract = import ./tests/sourceos-shell-service-graph-contract.nix { inherit pkgs; };
});

sourceos = {
Expand Down
12 changes: 12 additions & 0 deletions tests/sourceos-shell-service-graph-contract.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.runCommand "sourceos-shell-service-graph-contract" {
nativeBuildInputs = [ pkgs.gnugrep ];
} ''
test -f ${../linux/systemd/sourceos-shell.target}
grep -q 'sourceos-shell.service sourceos-router.service sourceos-pdf-secure.service sourceos-docd.service' ${../linux/systemd/sourceos-shell.target}
grep -q 'systemd.targets.sourceos-shell' ${../modules/nixos/sourceos-shell/default.nix}
grep -q 'partOf = \[ "sourceos-shell.target" \]' ${../modules/nixos/sourceos-shell/default.nix}
grep -q 'sourceos-shell.target' ${../docs/sourceos-shell-service-graph.md}
mkdir -p $out
echo validated > $out/result.txt
''