2024-10-23 06:41:50 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
rustPlatform,
|
|
|
|
fetchFromGitHub,
|
|
|
|
buildNpmPackage,
|
|
|
|
bash,
|
|
|
|
cmake,
|
|
|
|
cairo,
|
|
|
|
deno,
|
|
|
|
fetchurl,
|
|
|
|
go,
|
|
|
|
lld,
|
|
|
|
makeWrapper,
|
|
|
|
nsjail,
|
|
|
|
openssl,
|
|
|
|
pango,
|
|
|
|
pixman,
|
|
|
|
giflib,
|
|
|
|
pkg-config,
|
|
|
|
python3,
|
|
|
|
rustfmt,
|
|
|
|
stdenv,
|
|
|
|
swagger-cli,
|
2023-07-15 17:15:38 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
pname = "windmill";
|
2024-10-23 06:41:50 +00:00
|
|
|
version = "1.410.3";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
src = fetchFromGitHub {
|
2023-07-15 17:15:38 +00:00
|
|
|
owner = "windmill-labs";
|
2023-10-09 19:29:22 +00:00
|
|
|
repo = "windmill";
|
2023-07-15 17:15:38 +00:00
|
|
|
rev = "v${version}";
|
2024-10-23 06:41:50 +00:00
|
|
|
hash = "sha256-QPabzgSs+zxgI2dHcMY9ki4jEwm5jQbzwSMaIfBbFG8=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
pythonEnv = python3.withPackages (ps: [ ps.pip-tools ]);
|
|
|
|
|
|
|
|
frontend-build = buildNpmPackage {
|
2024-01-02 11:29:13 +00:00
|
|
|
inherit version src;
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
pname = "windmill-ui";
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
sourceRoot = "${src.name}/frontend";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-10-23 06:41:50 +00:00
|
|
|
npmDepsHash = "sha256-3AeDGd/4dGHm8kGKEH3sqNOuQ1LPjP5n4qOEaqVMm0w=";
|
2023-10-19 13:55:26 +00:00
|
|
|
|
|
|
|
# without these you get a
|
|
|
|
# FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
|
2024-10-23 06:41:50 +00:00
|
|
|
env.NODE_OPTIONS = "--max-old-space-size=8192";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
npm run generate-backend-client
|
|
|
|
'';
|
|
|
|
|
2024-10-23 06:41:50 +00:00
|
|
|
buildInputs = [
|
|
|
|
pixman
|
|
|
|
cairo
|
|
|
|
pango
|
|
|
|
giflib
|
|
|
|
];
|
|
|
|
nativeBuildInputs = [
|
|
|
|
python3
|
|
|
|
pkg-config
|
|
|
|
];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share
|
|
|
|
mv build $out/share/windmill-frontend
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
in
|
|
|
|
rustPlatform.buildRustPackage {
|
|
|
|
inherit pname version;
|
2024-01-02 11:29:13 +00:00
|
|
|
src = "${src}/backend";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
env = {
|
|
|
|
SQLX_OFFLINE = "true";
|
|
|
|
RUSTY_V8_ARCHIVE =
|
|
|
|
let
|
2024-10-23 06:41:50 +00:00
|
|
|
fetch_librusty_v8 =
|
|
|
|
args:
|
2023-08-10 07:59:29 +00:00
|
|
|
fetchurl {
|
|
|
|
name = "librusty_v8-${args.version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
url = "https://github.com/denoland/rusty_v8/releases/download/v${args.version}/librusty_v8_release_${stdenv.hostPlatform.rust.rustcTarget}.a";
|
2024-10-23 06:41:50 +00:00
|
|
|
sha256 =
|
|
|
|
args.shas.${stdenv.hostPlatform.system}
|
|
|
|
or (throw "Unsupported platform ${stdenv.hostPlatform.system}");
|
2024-06-20 14:57:18 +00:00
|
|
|
meta = {
|
|
|
|
inherit (args) version;
|
|
|
|
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
|
|
|
};
|
2023-08-10 07:59:29 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
fetch_librusty_v8 {
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "0.83.2";
|
2023-08-10 07:59:29 +00:00
|
|
|
shas = {
|
2024-06-05 15:53:02 +00:00
|
|
|
x86_64-linux = "sha256-RJNdy5jRZK3dTgrHsWuZZAHUyy1EogyNNuBekZ3Arrk=";
|
|
|
|
aarch64-linux = "sha256-mpOmuqtd7ob6xvrgH4P/6GLa/hXTS/ok0WOYo7+7ZhI=";
|
|
|
|
x86_64-darwin = "sha256-2o8CvJ3r5+4PLNGTySqPPDTqbU0piX4D1UtZMscMdHU=";
|
|
|
|
aarch64-darwin = "sha256-WHeITWSHjZxfQJndxcjsp4yIERKrKXSHFZ0UBc43p8o=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
};
|
2023-08-10 07:59:29 +00:00
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
2024-06-05 15:53:02 +00:00
|
|
|
"php-parser-rs-0.1.3" = "sha256-ZeI3KgUPmtjlRfq6eAYveqt8Ay35gwj6B9iOQRjQa9A=";
|
2023-08-10 07:59:29 +00:00
|
|
|
"progenitor-0.3.0" = "sha256-F6XRZFVIN6/HfcM8yI/PyNke45FL7jbcznIiqj22eIQ=";
|
2024-06-05 15:53:02 +00:00
|
|
|
"rustpython-ast-0.3.1" = "sha256-q9N+z3F6YICQuUMp3a10OS792tCq0GiSSlkcaLxi3Gs=";
|
|
|
|
"tiberius-0.12.2" = "sha256-s/S0K3hE+JNCrNVxoSCSs4myLHvukBYTwk2A5vZ7Ae8=";
|
2023-11-16 04:20:00 +00:00
|
|
|
"tinyvector-0.1.0" = "sha256-NYGhofU4rh+2IAM+zwe04YQdXY8Aa4gTmn2V2HtzRfI=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
./swagger-cli.patch
|
|
|
|
./run.go.config.proto.patch
|
|
|
|
./run.python3.config.proto.patch
|
|
|
|
./run.bash.config.proto.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
2023-10-19 13:55:26 +00:00
|
|
|
substituteInPlace windmill-worker/src/bash_executor.rs \
|
2023-07-15 17:15:38 +00:00
|
|
|
--replace '"/bin/bash"' '"${bash}/bin/bash"'
|
2023-08-10 07:59:29 +00:00
|
|
|
|
|
|
|
substituteInPlace windmill-api/src/lib.rs \
|
|
|
|
--replace 'unknown-version' 'v${version}'
|
|
|
|
|
|
|
|
substituteInPlace src/main.rs \
|
|
|
|
--replace 'unknown-version' 'v${version}'
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
pushd ..
|
|
|
|
|
|
|
|
mkdir -p frontend/build
|
|
|
|
cp -R ${frontend-build}/share/windmill-frontend/* frontend/build
|
|
|
|
cp ${src}/openflow.openapi.yaml .
|
|
|
|
|
|
|
|
popd
|
2023-07-15 17:15:38 +00:00
|
|
|
'';
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
buildInputs = [
|
|
|
|
openssl
|
|
|
|
rustfmt
|
|
|
|
lld
|
2024-01-02 11:29:13 +00:00
|
|
|
stdenv.cc.cc.lib
|
2023-10-09 19:29:22 +00:00
|
|
|
];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
makeWrapper
|
|
|
|
swagger-cli
|
|
|
|
cmake # for libz-ng-sys crate
|
|
|
|
];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
# needs a postgres database running
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
postFixup = ''
|
2024-10-23 06:41:50 +00:00
|
|
|
patchelf --set-rpath ${lib.makeLibraryPath [ openssl ]} $out/bin/windmill
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
wrapProgram "$out/bin/windmill" \
|
2024-10-23 06:41:50 +00:00
|
|
|
--prefix PATH : ${
|
|
|
|
lib.makeBinPath [
|
|
|
|
go
|
|
|
|
pythonEnv
|
|
|
|
deno
|
|
|
|
nsjail
|
|
|
|
bash
|
|
|
|
]
|
|
|
|
} \
|
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ stdenv.cc.cc.lib ]} \
|
2023-07-15 17:15:38 +00:00
|
|
|
--set PYTHON_PATH "${pythonEnv}/bin/python3" \
|
|
|
|
--set GO_PATH "${go}/bin/go" \
|
|
|
|
--set DENO_PATH "${deno}/bin/deno" \
|
|
|
|
--set NSJAIL_PATH "${nsjail}/bin/nsjail"
|
|
|
|
'';
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
meta = {
|
2024-01-02 11:29:13 +00:00
|
|
|
changelog = "https://github.com/windmill-labs/windmill/blob/${src.rev}/CHANGELOG.md";
|
2023-10-09 19:29:22 +00:00
|
|
|
description = "Open-source developer platform to turn scripts into workflows and UIs";
|
2023-07-15 17:15:38 +00:00
|
|
|
homepage = "https://windmill.dev";
|
2023-10-09 19:29:22 +00:00
|
|
|
license = lib.licenses.agpl3Only;
|
2024-10-23 06:41:50 +00:00
|
|
|
maintainers = with lib.maintainers; [
|
|
|
|
dit7ya
|
|
|
|
happysalada
|
|
|
|
];
|
2023-10-09 19:29:22 +00:00
|
|
|
mainProgram = "windmill";
|
2023-07-15 17:15:38 +00:00
|
|
|
# limited by librusty_v8
|
2024-10-23 06:41:50 +00:00
|
|
|
# nsjail not available on darwin
|
|
|
|
platforms = [
|
|
|
|
"x86_64-linux"
|
|
|
|
"aarch64-linux"
|
|
|
|
];
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
}
|