Skip to content

Commit

Permalink
flake: Reuse overlay to declare packages
Browse files Browse the repository at this point in the history
  • Loading branch information
phlmn committed Jan 19, 2025
1 parent fdc54c5 commit 5470bf0
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
flake-utils.url = "github:numtide/flake-utils";
};

outputs =
{
outputs = {
nixpkgs,
uv2nix,
pyproject-nix,
Expand All @@ -35,12 +34,17 @@
self,
...
}:
let
pythonPkgName = "python311";
in
{
overlays.default = (final: prev:
let
pkgs = prev;
lib = pkgs.lib;
python = pkgs.python311;
pkgs = import nixpkgs {
system = final.system;
};
lib = nixpkgs.lib;
python = pkgs."${pythonPkgName}";
in
{
transcribee-worker = import ./nix/pkgs/worker.nix {
Expand Down Expand Up @@ -70,9 +74,9 @@
let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
};
lib = nixpkgs.lib;
python = pkgs.python311;
python = pkgs."${pythonPkgName}";

ld_packages = [
pkgs.file # provides libmagic
Expand All @@ -83,15 +87,9 @@
in
{
packages = {
worker = (import ./nix/pkgs/worker.nix { inherit pkgs lib python uv2nix pyproject-nix pyproject-build-systems; });
backend = (import ./nix/pkgs/backend.nix { inherit pkgs lib python uv2nix pyproject-nix pyproject-build-systems; });
frontend = (import ./nix/pkgs/frontend.nix {
inherit pkgs lib;
versionInfo = {
commitHash = if (self ? rev) then self.rev else self.dirtyRev;
commitDate = self.lastModified;
};
});
backend = pkgs.transcribee-backend;
worker = pkgs.transcribee-worker;
frontend = pkgs.transcribee-frontend;
};

devShells.default = pkgs.mkShell {
Expand Down

0 comments on commit 5470bf0

Please sign in to comment.