-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
247 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
use nix shell.nix | ||
use flake ./ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
{ | ||
description = "transcribee monorepo"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; | ||
|
||
pyproject-nix = { | ||
url = "github:pyproject-nix/pyproject.nix"; | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
|
||
uv2nix = { | ||
url = "github:pyproject-nix/uv2nix"; | ||
inputs.pyproject-nix.follows = "pyproject-nix"; | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
|
||
pyproject-build-systems = { | ||
url = "github:pyproject-nix/build-system-pkgs"; | ||
inputs.pyproject-nix.follows = "pyproject-nix"; | ||
inputs.uv2nix.follows = "uv2nix"; | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
|
||
flake-utils.url = "github:numtide/flake-utils"; | ||
}; | ||
|
||
outputs = | ||
{ | ||
nixpkgs, | ||
uv2nix, | ||
pyproject-nix, | ||
pyproject-build-systems, | ||
flake-utils, | ||
... | ||
}: | ||
(flake-utils.lib.eachDefaultSystem | ||
(system: | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
lib = nixpkgs.lib; | ||
python = pkgs.python311; | ||
in | ||
{ | ||
packages = rec { | ||
worker = (import ./nix/pkgs/worker.nix { inherit pkgs lib python uv2nix pyproject-nix pyproject-build-systems system; }); | ||
backend = (import ./nix/pkgs/backend.nix { inherit pkgs lib python uv2nix pyproject-nix pyproject-build-systems system; }); | ||
}; | ||
|
||
devShells.default = pkgs.mkShell { | ||
packages = [ | ||
python | ||
pkgs.uv | ||
|
||
pkgs.overmind | ||
pkgs.wait4x | ||
pkgs.pre-commit | ||
|
||
python.pkgs.black | ||
pkgs.poethepoet | ||
|
||
pkgs.nodejs_20 | ||
pkgs.nodePackages.pnpm | ||
|
||
# nix tooling | ||
pkgs.nixpkgs-fmt | ||
|
||
# required by whispercppy | ||
pkgs.cmake | ||
|
||
# required by pre-commit | ||
pkgs.git | ||
pkgs.ruff | ||
|
||
pkgs.ffmpeg | ||
|
||
# for automerge-py | ||
pkgs.libiconv | ||
pkgs.rustc | ||
pkgs.cargo | ||
|
||
# provides libmagic which is needed by python-magic in the worker | ||
pkgs.file | ||
|
||
pkgs.icu.dev | ||
|
||
# Our database | ||
pkgs.postgresql_14 | ||
|
||
# Our database2 ? | ||
pkgs.redis | ||
]; | ||
|
||
shellHook = '' | ||
unset PYTHONPATH | ||
export UV_PYTHON_DOWNLOADS=never | ||
''; | ||
}; | ||
} | ||
)) // { | ||
lib = { | ||
# the frontend uses a fixed output hash for its npm dependencies | ||
# maybe we can get rid of the hash in the future by using a tool like dream2nix or use importNpmLock | ||
# but this seems to be a bit more complicated since we use git dependencies | ||
buildFrontendPackage = { system, npmDepsHash, versionInfo ? { } }: | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
lib = nixpkgs.lib; | ||
in | ||
(import ./nix/pkgs/frontend.nix { inherit pkgs lib system npmDepsHash versionInfo; }); | ||
}; | ||
}; | ||
} |