-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
89 lines (73 loc) · 2.45 KB
/
flake.nix
File metadata and controls
89 lines (73 loc) · 2.45 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
88
89
{
description =
"MorphEdit - Cross-platform audio editor for samplers and hardware instruments";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
# Node.js version
nodejs = pkgs.nodejs_24;
# Bun package
bun = pkgs.bun;
# Build inputs for the development environment
buildInputs = with pkgs; [
nodejs
bun
python3
typescript
markdownlint-cli
fd
# Development tools
git
curl
];
in {
devShells.default = pkgs.mkShell {
buildInputs = buildInputs;
shellHook = ''
echo "🎵 MorphEdit Development Environment"
echo "Node.js: $(node --version)"
echo "Bun: $(bun --version)"
# Ensure bun is in PATH
export PATH="$PATH:${bun}/bin"
# Python path for node-gyp
export PYTHON="${pkgs.python3}/bin/python"
echo ""
echo "Available commands:"
echo " bun install - Install dependencies"
echo " bun dev - Start development server"
echo " bun run build - Build for production"
echo " bun run electron:dev - Run Electron in development"
echo " bun run test - Run vitest tests"
echo " bun run test:e2e - Run E2E tests"
echo ""
'';
# Environment variables
env = {
# Set Python for node-gyp
PYTHON = "${pkgs.python3}/bin/python";
# Fix for some native modules
npm_config_build_from_source = "true";
# Node.js optimization for Vite (4GB heap)
NODE_OPTIONS = "--max-old-space-size=4096";
};
};
# Optional: provide packages for use in other flakes
packages = {
nodejs = nodejs;
bun = bun;
};
# Optional: provide the development environment as an app
apps.default = {
type = "app";
program = "${pkgs.writeShellScript "morphedit-dev" ''
echo "Starting MorphEdit development environment..."
${bun}/bin/bun dev
''}";
};
});
}