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
1 change: 1 addition & 0 deletions .github/workflows/build-win-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
cargo binstall --no-confirm --force "wasm-bindgen-cli@$env:WASM_BINDGEN_CLI_VERSION"

- name: Build Windows Bundle
shell: bash # `cargo-about` refuses to run in powershell
env:
CARGO_TERM_COLOR: always
run: npm run build-desktop
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/provide-shaders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: DeterminateSystems/magic-nix-cache-action@main

- name: Build graphene raster nodes shaders
run: nix build .nix#raster-nodes-shaders && cp result raster_nodes_shaders_entrypoint.wgsl
run: nix build .nix#graphite-raster-nodes-shaders && cp result raster_nodes_shaders_entrypoint.wgsl

- name: Upload graphene raster nodes shaders to artifacts repository
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
branding/
target/
third-party-licenses.txt*
result/
.flatpak-builder/
*.spv
Expand Down
4 changes: 3 additions & 1 deletion .nix/deps/cef.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, inputs, ... }:
{ pkgs, ... }:

let
cefPath = pkgs.cef-binary.overrideAttrs (finalAttrs: {
Expand All @@ -10,6 +10,8 @@ let
mv ./Resources/* $out/
mv ./include $out/

cat ./CREDITS.html | ${pkgs.xz}/bin/xz -9 -e -c > $out/CREDITS.html.xz

echo '${
builtins.toJSON {
type = "minimal";
Expand Down
2 changes: 1 addition & 1 deletion .nix/deps/rust-gpu.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, inputs, ... }:
{ pkgs, ... }:

let
extensions = [
Expand Down
60 changes: 51 additions & 9 deletions .nix/dev.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,58 @@
{
pkgs,
deps,
libs,
tools,
...
}:
{ pkgs, deps, ... }:

let
libs = [
pkgs.wayland
pkgs.vulkan-loader
pkgs.libGL
pkgs.openssl
pkgs.libraw

# X11 Support
pkgs.libxkbcommon
pkgs.libXcursor
pkgs.libxcb
pkgs.libX11
];
in
pkgs.mkShell (
{
packages = tools.all ++ libs.all;
packages = libs ++ [
pkgs.pkg-config

pkgs.lld
pkgs.nodejs
pkgs.nodePackages.npm
pkgs.binaryen
pkgs.wasm-bindgen-cli_0_2_100
pkgs.wasm-pack
pkgs.cargo-about

pkgs.rustc
pkgs.cargo
pkgs.rust-analyzer
pkgs.clippy
pkgs.rustfmt

pkgs.git

pkgs.cargo-watch
pkgs.cargo-nextest
pkgs.cargo-expand

# Linker
pkgs.mold

# Profiling tools
pkgs.gnuplot
pkgs.samply
pkgs.cargo-flamegraph

# Plotting tools
pkgs.graphviz
];

LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath libs.all}:${deps.cef.env.CEF_PATH}";
LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath libs}:${deps.cef.env.CEF_PATH}";
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 = ''
Expand Down
34 changes: 0 additions & 34 deletions .nix/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

197 changes: 69 additions & 128 deletions .nix/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
crane.url = "github:ipetkov/crane";

# This is used to provide a identical development shell at `shell.nix` for users that do not use flakes
Expand All @@ -27,143 +26,85 @@

outputs =
inputs:
inputs.flake-utils.lib.eachDefaultSystem (
system:
(
let
info = {
pname = "graphite";
version = "unstable";
src = pkgs.lib.cleanSourceWith {
src = ./..;
filter = path: type: !(type == "directory" && builtins.baseNameOf path == ".nix");
};
};

pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ (import inputs.rust-overlay) ];
};

deps = {
crane = import ./deps/crane.nix { inherit pkgs inputs; };
cef = import ./deps/cef.nix { inherit pkgs inputs; };
rustGPU = import ./deps/rust-gpu.nix { inherit pkgs inputs; };
};

libs = rec {
desktop = [
pkgs.wayland
pkgs.openssl
pkgs.vulkan-loader
pkgs.libraw
pkgs.libGL
];
desktop-x11 = [
pkgs.libxkbcommon
pkgs.xorg.libXcursor
pkgs.xorg.libxcb
pkgs.xorg.libX11
];
desktop-all = desktop ++ desktop-x11;
all = desktop-all;
};

tools = rec {
desktop = [
pkgs.pkg-config
];
frontend = [
pkgs.lld
pkgs.nodejs
pkgs.nodePackages.npm
pkgs.binaryen
pkgs.wasm-bindgen-cli_0_2_100
pkgs.wasm-pack
pkgs.cargo-about
];
dev = [
pkgs.rustc
pkgs.cargo
pkgs.rust-analyzer
pkgs.clippy
pkgs.rustfmt

pkgs.git
systems = [
"x86_64-linux"
"aarch64-linux"
];
forAllSystems = f: inputs.nixpkgs.lib.genAttrs systems (system: f system);
args =
system:
(
let
lib = inputs.nixpkgs.lib // {
call = p: import p args;
};

pkgs.cargo-watch
pkgs.cargo-nextest
pkgs.cargo-expand
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ (import inputs.rust-overlay) ];
};

# Linker
pkgs.mold
info = {
pname = "graphite";
version = "unstable";
src = inputs.nixpkgs.lib.cleanSourceWith {
src = ./..;
filter = path: type: !(type == "directory" && builtins.baseNameOf path == ".nix");
};
cargoVendored = deps.crane.lib.vendorCargoDeps { inherit (info) src; };
Copy link

@cubic-dev-ai cubic-dev-ai bot Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: info.cargoVendored is defined but never used anywhere in the codebase. Either this should be consumed by downstream derivations (e.g., via inherit (info) cargoVendored; in graphite.nix) or removed to avoid dead code and unnecessary evaluation.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .nix/flake.nix, line 56:

<comment>`info.cargoVendored` is defined but never used anywhere in the codebase. Either this should be consumed by downstream derivations (e.g., via `inherit (info) cargoVendored;` in `graphite.nix`) or removed to avoid dead code and unnecessary evaluation.</comment>

<file context>
@@ -27,143 +26,85 @@
+                  src = ./..;
+                  filter = path: type: !(type == "directory" && builtins.baseNameOf path == ".nix");
+                };
+                cargoVendored = deps.crane.lib.vendorCargoDeps { inherit (info) src; };
+              };
 
</file context>
Fix with Cubic

};

# Profiling tools
pkgs.gnuplot
pkgs.samply
pkgs.cargo-flamegraph
deps = {
crane = lib.call ./deps/crane.nix;
cef = lib.call ./deps/cef.nix;
rustGPU = lib.call ./deps/rust-gpu.nix;
};

# Plotting tools
pkgs.graphviz
];
all = desktop ++ frontend ++ dev;
};
args = {
inherit system;
inherit (inputs) self;
inherit inputs;
inherit pkgs;
inherit lib;
inherit info;
inherit deps;
}
// inputs;
in
args
);
withArgs = f: forAllSystems (system: f (args system));
in
{
packages = rec {
graphiteWithArgs =
args:
(import ./pkgs/graphite.nix {
pkgs = pkgs // {
inherit raster-nodes-shaders;
};
inherit
info
inputs
deps
libs
tools
;
})
args;
graphite = graphiteWithArgs { };
graphite-dev = graphiteWithArgs { dev = true; };
graphite-without-resources = graphiteWithArgs { embeddedResources = false; };
graphite-without-resources-dev = graphiteWithArgs {
embeddedResources = false;
dev = true;
};
graphite-bundle = import ./pkgs/graphite-bundle.nix {
inherit pkgs graphite;
};
graphite-flatpak-manifest = import ./pkgs/graphite-flatpak-manifest.nix {
inherit pkgs;
archive = graphite-bundle.tar;
};
#TODO: graphene-cli = import ./pkgs/graphene-cli.nix { inherit info pkgs inputs deps libs tools; };
raster-nodes-shaders = import ./pkgs/raster-nodes-shaders.nix {
inherit
info
pkgs
inputs
deps
libs
tools
;
};
packages = withArgs (
{ lib, ... }:
rec {
default = graphite;
graphite = (lib.call ./pkgs/graphite.nix) { };
graphite-dev = (lib.call ./pkgs/graphite.nix) { dev = true; };
graphite-raster-nodes-shaders = lib.call ./pkgs/graphite-raster-nodes-shaders.nix;
graphite-branding = lib.call ./pkgs/graphite-branding.nix;
graphite-bundle = lib.call ./pkgs/graphite-bundle.nix;
graphite-flatpak-manifest = lib.call ./pkgs/graphite-flatpak-manifest.nix;

# TODO: graphene-cli = lib.call ./pkgs/graphene-cli.nix;

default = graphite;
};
tools = {
third-party-licenses = lib.call ./pkgs/tools/third-party-licenses.nix;
};
}
);

devShells.default = import ./dev.nix {
inherit
pkgs
deps
libs
tools
;
};
devShells = withArgs (
{ lib, ... }:
{
default = lib.call ./dev.nix;
}
);

formatter = pkgs.nixfmt-tree;
formatter = withArgs ({ pkgs, ... }: pkgs.nixfmt-tree);
}
);
}
Loading