-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathflake.nix
More file actions
87 lines (78 loc) · 2.83 KB
/
Copy pathflake.nix
File metadata and controls
87 lines (78 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{
description = "Development environment for a Tauri-based Rust ebook library app";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
in {
packages.riida-mcp = pkgs.writeShellApplication {
name = "riida-mcp";
runtimeInputs = [ pkgs.nodejs_22 ];
# dist/index.js is a local build artifact; resolve via $PWD so the
# script works regardless of where nix stored the derivation.
text = ''
exec node "$PWD/mcp-server/dist/index.js"
'';
};
devShells.default = pkgs.mkShell {
packages = with pkgs; [
cargo
cargo-audit
cargo-llvm-cov
cargo-machete
cargo-mutants
cargo-nextest
clippy
nodejs_22
pkg-config
python3
python3Packages.pyyaml
rust-analyzer
rustc
rustfmt
sqlite
];
buildInputs = with pkgs; [
openssl
pdfium-binaries
];
env = {
RUST_BACKTRACE = "1";
CARGO_TERM_COLOR = "always";
# Full-text search extracts PDF text via pdfium-render with runtime
# dynamic binding (no build-time linking). Point the backend at the
# prebuilt libpdfium shipped by nixpkgs `pdfium-binaries`. The bundled
# release build ships its own libpdfium as a Tauri resource instead.
PDFIUM_LIB_DIR = "${pkgs.pdfium-binaries}/lib";
# cargo-llvm-cov needs llvm-cov/llvm-profdata matching rustc's LLVM
# version (this toolchain reports LLVM 21.1.8). The rustc wrapper
# does not ship the llvm-tools-preview component, so point the tools
# at the matching LLVM build explicitly. Bump this alongside any
# rustc upgrade that changes the major LLVM version.
LLVM_COV = "${pkgs.llvmPackages_21.llvm}/bin/llvm-cov";
LLVM_PROFDATA = "${pkgs.llvmPackages_21.llvm}/bin/llvm-profdata";
};
shellHook = ''
export PROJECT_ROOT="$PWD"
mkdir -p "$PROJECT_ROOT/.cargo"
echo
echo "riida development shell"
echo " Rust : $(rustc --version)"
echo " Cargo: $(cargo --version)"
echo " Node : $(node --version)"
echo
echo "Next steps:"
echo " 1. cargo install create-tauri-app"
echo " 2. npm create tauri-app@latest"
echo " 3. npm run tauri dev"
echo
'';
};
});
}