Skip to content
Open
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
9 changes: 4 additions & 5 deletions .nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ let

deps = {
crane = lib.call ./deps/crane.nix;
cef = lib.call ./deps/cef.nix;
rustGPU = lib.call ./deps/rust-gpu.nix;
};

Expand Down Expand Up @@ -62,13 +61,13 @@ in
graphite-bundle = (lib.call ./pkgs/graphite-bundle.nix) { };
graphite-bundle-dev = (lib.call ./pkgs/graphite-bundle.nix) { graphite = graphite-dev; };
graphite-flatpak-manifest = (lib.call ./pkgs/graphite-flatpak-manifest.nix) { };
graphite-flatpak-manifest-dev = (lib.call ./pkgs/graphite-flatpak-manifest.nix) { graphite-bundle = graphite-bundle-dev; };
graphite-flatpak-manifest-dev = (lib.call ./pkgs/graphite-flatpak-manifest.nix) {
graphite-bundle = graphite-bundle-dev;
};

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

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

Expand Down
27 changes: 0 additions & 27 deletions .nix/deps/cef.nix

This file was deleted.

17 changes: 8 additions & 9 deletions .nix/deps/rust-gpu.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
{ pkgs, ... }:

let
extensions = [
"rust-src"
"rust-analyzer"
"clippy"
"cargo"
"rustc-dev"
"llvm-tools"
];
toolchain = pkgs.rust-bin.nightly."2026-04-11".default.override {
inherit extensions;
extensions = [
"rust-src"
"rust-analyzer"
"clippy"
"cargo"
"rustc-dev"
"llvm-tools"
];
};
cargo = pkgs.writeShellScriptBin "cargo" ''
#!${pkgs.lib.getExe pkgs.bash}
Expand Down
18 changes: 12 additions & 6 deletions .nix/dev.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{ pkgs, deps, ... }:
{
pkgs,
deps,
self,
system,
...
}:

let
libs = [
Expand Down Expand Up @@ -51,13 +57,13 @@ pkgs.mkShell (
pkgs.graphviz
];

LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath libs}:${deps.cef.env.CEF_PATH}";
CEF_PATH = self.packages.${system}.graphite-cef;
LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath libs}:${self.packages.${system}.graphite-cef}";
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'
# '';
# shellHook = ''
# alias cargo='mold --run cargo'
# '';
}
// deps.cef.env
// deps.rustGPU.env
)
3 changes: 2 additions & 1 deletion .nix/pkgs/graphite-bundle.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
pkgs,
deps,
self,
system,
...
Expand Down Expand Up @@ -33,7 +34,7 @@ let
cp -r ${graphite}/share out/share
mkdir -p out/lib/cef
mkdir -p ./cef
tar -xvf ${pkgs.cef-binary.src} -C ./cef --strip-components=1
tar -xvf ${self.packages.${system}.graphite-cef.src} -C ./cef --strip-components=1
cp -r ./cef/Release/* out/lib/cef/
cp -r ./cef/Resources/* out/lib/cef/
find "out/lib/cef/locales" -type f ! -name 'en-US*' -delete
Expand Down
45 changes: 45 additions & 0 deletions .nix/pkgs/graphite-cef/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{ pkgs, ... }:

let
versionFile = builtins.fromJSON (builtins.readFile ./version.json);

version = versionFile.version;
hash = selectSystem versionFile.hashes;

selectSystem =
attrs:
attrs.${pkgs.stdenv.hostPlatform.system}
or (throw "Unsupported system ${pkgs.stdenv.hostPlatform.system}");

src = pkgs.fetchurl {
url = "https://cef-builds.spotifycdn.com/cef_binary_${version}_${
selectSystem {
aarch64-linux = "linuxarm64";
x86_64-linux = "linux64";
}
}_minimal.tar.bz2";
hash = hash;
};
in
pkgs.cef-binary.overrideAttrs (finalAttrs: {
version = builtins.head (builtins.split "\\+" version);
inherit src;
postInstall = ''
rm -r $out/* $out/.* || true
strip ./Release/*.so*
mv ./Release/* $out/
find "./Resources/locales" -maxdepth 1 -type f ! -name 'en-US.pak' -delete
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";
name = builtins.baseNameOf finalAttrs.src.url;
sha1 = "";
}
}' > $out/archive.json
'';
})
7 changes: 7 additions & 0 deletions .nix/pkgs/graphite-cef/version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"version": "146.0.12+g6214c8e+chromium-146.0.7680.179",
"hashes": {
"aarch64-linux": "sha256-pi3fV3O31YMHcOh+/lnk2gWI6/MaSNAiUgFhD09d7u0=",
"x86_64-linux": "sha256-b2HKaSEEXkZsnsBw9bL2JGmKWwRN5l2wu/O1DxfhAgE="
}
}
7 changes: 4 additions & 3 deletions .nix/pkgs/graphite.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ let
pkgs.pkg-config
pkgs.lld
];
env = deps.cef.env;
env.CEF_PATH = self.packages.${system}.graphite-cef;
buildPhase =
let
profile = if dev then "dev" else "release";
Expand Down Expand Up @@ -97,10 +97,11 @@ deps.crane.lib.buildPackage (
npmConfigScript = "setup";
makeCacheWritable = true;

env = deps.cef.env // {
env = {
RASTER_NODES_SHADER_PATH = self.packages.${system}.graphite-raster-nodes-shaders;
GRAPHITE_GIT_COMMIT_HASH = self.rev or "unknown";
GRAPHITE_GIT_COMMIT_DATE = self.lastModified or "unknown";
CEF_PATH = self.packages.${system}.graphite-cef;
};

postPatch = ''
Expand Down Expand Up @@ -149,7 +150,7 @@ deps.crane.lib.buildPackage (
remove-references-to -t "${common.cargoVendorDir}" $out/bin/graphite

patchelf \
--set-rpath "${pkgs.lib.makeLibraryPath libs}:${deps.cef.env.CEF_PATH}" \
--set-rpath "${pkgs.lib.makeLibraryPath libs}:${self.packages.${system}.graphite-cef}" \
--add-needed libGL.so \
$out/bin/graphite
'';
Expand Down
31 changes: 0 additions & 31 deletions .nix/pkgs/tools/third-party-licenses.nix

This file was deleted.

Loading
Loading