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
17 changes: 17 additions & 0 deletions .github/workflows/build-nix-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Build Nix Package

on:
workflow_dispatch: {}

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main

- name: Build Nix Package Dev
run: nix build .nix#graphite-dev --print-build-logs
26 changes: 0 additions & 26 deletions .nix/cef.nix

This file was deleted.

30 changes: 30 additions & 0 deletions .nix/deps/cef.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{ pkgs, inputs, ... }:

let
libcef = pkgs.libcef.overrideAttrs (
_: _: {
postInstall = ''
strip $out/lib/*
'';
}
);
cefPath = pkgs.runCommand "cef-path" { } ''
mkdir -p $out

ln -s ${libcef}/include $out/include
find ${libcef}/lib -type f -name "*" -exec ln -s {} $out/ \;
find ${libcef}/libexec -type f -name "*" -exec ln -s {} $out/ \;
cp -r ${libcef}/share/cef/* $out/

echo '${
builtins.toJSON {
type = "minimal";
name = builtins.baseNameOf libcef.src.url;
sha1 = "";
}
}' > $out/archive.json
'';
in
{
env.CEF_PATH = cefPath;
}
5 changes: 5 additions & 0 deletions .nix/deps/crane.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{ pkgs, inputs, ... }:

{
lib = inputs.crane.mkLib pkgs;
}
58 changes: 58 additions & 0 deletions .nix/deps/rust-gpu.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{ pkgs, inputs, ... }:

let
extensions = [
"rust-src"
"rust-analyzer"
"clippy"
"cargo"
"rustc-dev"
"llvm-tools"
];
toolchain = pkgs.rust-bin.nightly."2025-06-23".default.override {
inherit extensions;
};
cargo = pkgs.writeShellScriptBin "cargo" ''
#!${pkgs.lib.getExe pkgs.bash}

filtered_args=()
for arg in "$@"; do
case "$arg" in
+nightly|+nightly-*) ;;
*) filtered_args+=("$arg") ;;
esac
done

exec ${toolchain}/bin/cargo ${"\${filtered_args[@]}"}
'';
rustc_codegen_spirv =
(pkgs.makeRustPlatform {
cargo = toolchain;
rustc = toolchain;
}).buildRustPackage
(finalAttrs: {
pname = "rustc_codegen_spirv";
version = "0-unstable-2025-08-04";
src = pkgs.fetchFromGitHub {
owner = "Firestar99";
repo = "rust-gpu-new";
rev = "c12f216121820580731440ee79ebc7403d6ea04f";
hash = "sha256-rG1cZvOV0vYb1dETOzzbJ0asYdE039UZImobXZfKIno=";
};
cargoHash = "sha256-AEigcEc5wiBd3zLqWN/2HSbkfOVFneAqNvg9HsouZf4=";
cargoBuildFlags = [
"-p"
"rustc_codegen_spirv"
"--features=use-compiled-tools"
"--no-default-features"
];
doCheck = false;
});
in
{
toolchain = toolchain;
env = {
RUST_GPU_PATH_OVERRIDE = "${cargo}/bin:${toolchain}/bin";
RUSTC_CODEGEN_SPIRV_PATH = "${rustc_codegen_spirv}/lib/librustc_codegen_spirv.so";
};
}
22 changes: 22 additions & 0 deletions .nix/dev.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
pkgs,
deps,
libs,
tools,
...
}:

pkgs.mkShell (
{
packages = tools.all;

LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath libs.desktop-all}:${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 = ''
alias cargo='mold --run cargo'
'';
}
// deps.cef.env
// deps.rustGPU.env
)
16 changes: 16 additions & 0 deletions .nix/flake.lock

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

Loading