WEFT_OS/flake.nix
Marco Allegretti 19798976c6
build(nixos): build the workspace once with Servo embedded for the VM
The shells were packaged without servo-embed, so the VM's system shell
had no rendering engine, and each package compiled the workspace on its
own. One cargo build now produces every binary with Servo enabled,
links the prebuilt SpiderMonkey archive instead of compiling it, fills
in the Servo source hash, installs the UI kit the shells inject, and
adds the libraries Servo and winit open at run time to the shells' rpath.

Not yet validated: the Nix build is still running.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QS8QcxvhVJwU3X2qhPamUW
2026-10-11 08:44:16 +00:00

74 lines
1.9 KiB
Nix

{
description = "WEFT OS — capability-secure Wayland compositor and app runtime";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
in
flake-utils.lib.eachSystem supportedSystems (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlays.default ];
};
rust193 = pkgs.rust-bin.stable."1.93.0".default;
weftPkgs = pkgs.callPackage ./infra/nixos/weft-packages.nix {
inherit rust193;
};
in
{
packages = weftPkgs // {
default = weftPkgs.weft;
};
devShells.default = pkgs.mkShell {
name = "weft-dev";
nativeBuildInputs = with pkgs; [
rust193
pkg-config
cmake
clang
python3
];
buildInputs = with pkgs; [
openssl
libdrm
mesa
wayland
wayland-protocols
libxkbcommon
libseat
udev
dbus
libGL
];
shellHook = ''
export LIBCLANG_PATH="${pkgs.libclang.lib}/lib"
export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath [
pkgs.mesa pkgs.wayland pkgs.libxkbcommon pkgs.libdrm
]}:$LD_LIBRARY_PATH"
'';
};
}
) // {
nixosConfigurations.weft-vm = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit self;
rustOverlay = rust-overlay.overlays.default;
};
modules = [
./infra/nixos/configuration.nix
];
};
};
}