mirror of
https://github.com/marcoallegretti/WEFT_OS.git
synced 2026-11-22 08:13:59 +00:00
fix(nixos): start weft-appd and give the session its shell page and app shell
The reference session could not show the system UI or open an app, even with every package built: - weft-servo-shell ignores command-line arguments, yet infra/systemd/servo-shell.service passed it the page path, and the binary's packaged fallback named a path no package provides. The Nix package did not install the page and its NixOS service did not name it either, so the shell exited at startup. - The NixOS weft-appd user service was wanted by nothing, so it never started, and it had no WEFT_APP_SHELL_BIN, so every launch would stop before its UI host started. The weft-servo-shell package now installs the page as share/weft/shell/system-ui.html, the binary falls back to that path in the package's active revision, the systemd unit drops the ignored argument, and the NixOS service sets WEFT_SYSTEM_UI_HTML to the package's copy. weft-appd is wanted by the graphical session and is given the app shell. docs/building.md lists what still keeps the image from a working desktop: the Servo source hash, servo-embed in the shell packages and the fixed Wayland socket name.
This commit is contained in:
parent
5c82b540e6
commit
5db3d1ddce
5 changed files with 25 additions and 6 deletions
|
|
@ -37,12 +37,17 @@ fn run() -> anyhow::Result<()> {
|
|||
embed_servo(&wayland_display, &html_path, ws_port)
|
||||
}
|
||||
|
||||
/// Where the weft-servo-shell package installs the system UI page;
|
||||
/// `infra/systemd/servo-shell.service` relies on it.
|
||||
const PACKAGED_SYSTEM_UI: &str =
|
||||
"/packages/system/weft-servo-shell/active/share/weft/shell/system-ui.html";
|
||||
|
||||
fn system_ui_html_path() -> anyhow::Result<PathBuf> {
|
||||
if let Ok(p) = std::env::var("WEFT_SYSTEM_UI_HTML") {
|
||||
return Ok(PathBuf::from(p));
|
||||
}
|
||||
|
||||
let packaged = PathBuf::from("/packages/system/servo-shell/active/share/weft/system-ui.html");
|
||||
let packaged = PathBuf::from(PACKAGED_SYSTEM_UI);
|
||||
if packaged.exists() {
|
||||
return Ok(packaged);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,7 +139,13 @@ Run with QEMU:
|
|||
bash infra/vm/run.sh
|
||||
```
|
||||
|
||||
See `infra/nixos/weft-packages.nix` for the package derivations. Its `outputHashes` hold one hash per git source in `Cargo.lock` (the Servo and Stylo forks); every package vendors them, so they must match the pinned revisions for any Nix package to build. The Nix shell packages do not yet enable `servo-embed`.
|
||||
See `infra/nixos/weft-packages.nix` for the package derivations. Its `outputHashes` hold one hash per git source in `Cargo.lock` (the Servo and Stylo forks); every package vendors them, so they must match the pinned revisions for any Nix package to build.
|
||||
|
||||
The VM's user session starts `weft-compositor`, `weft-servo-shell` with the system UI page its package installs, and `weft-appd` with the runtime, app shell, file portal and mount helper packages. The image is not yet bootable to a working desktop:
|
||||
|
||||
- the Servo source hash in `outputHashes` is still a placeholder, so no package builds until a Nix build reports it;
|
||||
- the shell packages do not enable `servo-embed`, so `weft-servo-shell` and `weft-app-shell` exit at startup;
|
||||
- the shell's service names the compositor's socket `wayland-1`, the first name the compositor tries, rather than learning it.
|
||||
|
||||
## CI
|
||||
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@
|
|||
wantedBy = [ "graphical-session.target" ];
|
||||
environment = {
|
||||
WAYLAND_DISPLAY = "wayland-1";
|
||||
WEFT_SYSTEM_UI_HTML = "${pkgs.weft.weft-servo-shell}/share/weft/shell/system-ui.html";
|
||||
};
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
|
|
@ -109,6 +110,7 @@
|
|||
description = "WEFT Application Daemon";
|
||||
requires = [ "weft-compositor.service" ];
|
||||
after = [ "weft-compositor.service" "weft-servo-shell.service" ];
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
serviceConfig = {
|
||||
Type = "notify";
|
||||
ExecStart = "${pkgs.weft.weft-appd}/bin/weft-appd";
|
||||
|
|
@ -116,6 +118,7 @@
|
|||
RestartSec = "1s";
|
||||
Environment = [
|
||||
"WEFT_RUNTIME_BIN=${pkgs.weft.weft-runtime}/bin/weft-runtime"
|
||||
"WEFT_APP_SHELL_BIN=${pkgs.weft.weft-app-shell}/bin/weft-app-shell"
|
||||
"WEFT_FILE_PORTAL_BIN=${pkgs.weft.weft-file-portal}/bin/weft-file-portal"
|
||||
"WEFT_MOUNT_HELPER=${pkgs.weft.weft-mount-helper}/bin/weft-mount-helper"
|
||||
];
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ let
|
|||
nativeBuildInputs = with pkgs; [ pkg-config ];
|
||||
};
|
||||
|
||||
mkWeftPkg = { pname, extraBuildInputs ? [], extraNativeBuildInputs ? [], cargoFlags ? [], extraEnv ? {}, preBuild ? "" }: rustPlatform.buildRustPackage (commonArgs // {
|
||||
inherit pname preBuild;
|
||||
mkWeftPkg = { pname, extraBuildInputs ? [], extraNativeBuildInputs ? [], cargoFlags ? [], extraEnv ? {}, preBuild ? "", postInstall ? "" }: rustPlatform.buildRustPackage (commonArgs // {
|
||||
inherit pname preBuild postInstall;
|
||||
cargoBuildFlags = [ "--package" pname ] ++ cargoFlags;
|
||||
cargoTestFlags = [ "--package" pname ];
|
||||
buildInputs = extraBuildInputs;
|
||||
|
|
@ -50,6 +50,10 @@ in {
|
|||
|
||||
weft-servo-shell = mkWeftPkg {
|
||||
pname = "weft-servo-shell";
|
||||
# The system UI page, at the path the shell's units name.
|
||||
postInstall = ''
|
||||
install -Dm644 infra/shell/system-ui.html $out/share/weft/shell/system-ui.html
|
||||
'';
|
||||
};
|
||||
|
||||
weft-app-shell = mkWeftPkg {
|
||||
|
|
|
|||
|
|
@ -8,8 +8,9 @@ After=weft-compositor.service
|
|||
Type=simple
|
||||
PassEnvironment=WAYLAND_DISPLAY XDG_RUNTIME_DIR DISPLAY
|
||||
Environment=WEFT_APPD_WS_PORT=7410
|
||||
ExecStart=/packages/system/weft-servo-shell/active/bin/weft-servo-shell \
|
||||
/packages/system/weft-servo-shell/active/share/weft/shell/system-ui.html
|
||||
# The page is the package's share/weft/shell/system-ui.html; set
|
||||
# WEFT_SYSTEM_UI_HTML to use another.
|
||||
ExecStart=/packages/system/weft-servo-shell/active/bin/weft-servo-shell
|
||||
Restart=on-failure
|
||||
RestartSec=2
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue