Skip to content

Implement basic desktop app with chromium embeded framework #2874

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
35 changes: 28 additions & 7 deletions .nix/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,36 @@
pkgs-unstable = import nixpkgs-unstable {
inherit system overlays;
};

rustc-wasm = pkgs.rust-bin.stable.latest.default.override {
targets = [ "wasm32-unknown-unknown" ];
extensions = [ "rust-src" "rust-analyzer" "clippy" "cargo" ];
};

custom-cef = pkgs.cef-binary.overrideAttrs (finalAttrs: previousAttrs: {
version = "138.0.15";
gitRevision = "d0f1f64";
chromiumVersion = "138.0.7204.50";
srcHash = "sha256-9MeJCV0Q2dnOeQ+C5QWBxD6PVzZh9wnhICGI8ak3SAM=";
nativeBuildInputs = previousAttrs.nativeBuildInputs ++ [ pkgs.rsync ];
installPhase = ''
runHook preInstall

cd ..
mkdir -p $out
cp -r Release/* $out
cp -r Resources/* $out
rsync ./* $out --exclude Release --exclude Resources

runHook postInstall
'';
});

# Shared build inputs - system libraries that need to be in LD_LIBRARY_PATH
buildInputs = with pkgs; [
# System libraries
wayland
wayland.dev
openssl
vulkan-loader
mesa
Expand Down Expand Up @@ -88,23 +109,23 @@
cargo-watch
cargo-nextest
cargo-expand

# Profiling tools
gnuplot
samply
cargo-flamegraph

];
in
{
# Development shell configuration
devShells.default = pkgs.mkShell {
packages = buildInputs ++ buildTools ++ devTools;

LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
GIO_MODULE_DIR="${pkgs.glib-networking}/lib/gio/modules/";
XDG_DATA_DIRS="${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}:$XDG_DATA_DIRS";

LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath buildInputs}:/${custom-cef}";
CEF_PATH = custom-cef;
CEF_PATH_NO_CHECK = 1;
GIO_MODULE_DIR = "${pkgs.glib-networking}/lib/gio/modules/";
XDG_DATA_DIRS = "${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}:$XDG_DATA_DIRS";

shellHook = ''
alias cargo='mold --run cargo'
Expand Down
Loading
Loading