19 stdenv.mkDerivation (finalAttrs: {
23 src = fetchFromGitHub {
26 rev = "n8n@${finalAttrs.version}";
27 hash = "sha256-acbC6MO2wM9NsjqUqcs8jPNHfBg/P0wEYF5MxbnFhQQ=";
30 pnpmDeps = pnpm.fetchDeps {
31 inherit (finalAttrs) pname version src;
32 hash = "sha256-h2hIOVK9H5OlyhyyoRs113CbE4z4SIxVVPha0Ia9I4A=";
37 python3 # required to build sqlite3 bindings
38 node-gyp # required to build sqlite3 bindings
39 cacert # required for rustls-native-certs (dependency of turbo build tool)
41 ] ++ lib.optional stdenv.hostPlatform.isDarwin [ xcbuild ];
53 pushd node_modules/sqlite3
57 # TODO: use deploy after resolved https://github.com/pnpm/pnpm/issues/5315
58 pnpm build --filter=n8n
64 echo "Removing non-deterministic files"
66 rm -r $(find -type d -name .turbo)
67 rm node_modules/.modules.yaml
68 rm packages/nodes-base/dist/types/nodes.json
70 echo "Removed non-deterministic files"
76 mkdir -p $out/{bin,lib/n8n}
77 mv {packages,node_modules} $out/lib/n8n
79 makeWrapper $out/lib/n8n/packages/cli/bin/n8n $out/bin/n8n \
80 --set N8N_RELEASE_TYPE "stable"
86 tests = nixosTests.n8n;
87 updateScript = nix-update-script { };
93 description = "Free and source-available fair-code licensed workflow automation tool";
95 Free and source-available fair-code licensed workflow automation tool.
96 Easily automate tasks across different services.
98 homepage = "https://n8n.io";
99 changelog = "https://github.com/n8n-io/n8n/releases/tag/${finalAttrs.src.rev}";
100 maintainers = with lib.maintainers; [
103 license = lib.licenses.sustainableUse;
105 platforms = lib.platforms.unix;