Skip to content

Commit

Permalink
flake: add overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
phlmn committed Jan 14, 2025
1 parent eb1b290 commit 98bf3ef
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
32 changes: 30 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,38 @@
self,
...
}:
{
overlays.default = (final: prev:
let
pkgs = prev;
lib = pkgs.lib;
in
{
transcribee-backend = import ./nix/pkgs/backend.nix {
inherit pkgs lib uv2nix pyproject-nix pyproject-build-systems;
python = prev.python311;
};

transcribee-frontend = import ./nix/pkgs/frontend.nix {
inherit pkgs lib;

versionInfo = {
commitHash = if (self ? rev) then self.rev else self.dirtyRev;
commitDate = lib.readFile "${prev.runCommand "timestamp" { env.when = self.lastModified; } "echo -n `date -d @$when --iso-8601=s` > $out"}";
};
};
});

nixosModules.default = {
nixpkgs.overlays = [ self.overlays.default ];
};
} //
(flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs {
inherit system;
};
lib = nixpkgs.lib;
python = pkgs.python311;

Expand All @@ -50,7 +78,7 @@
];
in
{
packages = rec {
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 {
Expand Down
2 changes: 1 addition & 1 deletion nix/pkgs/frontend.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pkgs.buildNpmPackage (lib.fix (self: {
gitDeps = (lib.attrsets.filterAttrs (name: pkgInfo:
(lib.hasPrefix "node_modules/" name)
&& (lib.hasPrefix "git" (pkgInfo.resolved or "")))
(pkgs.lib.importJSON (self.src + "/package-lock.json")).packages);
(lib.importJSON (self.src + "/package-lock.json")).packages);
in lib.attrsets.mapAttrs (name: pkgInfo:
let
src = builtins.fetchGit {
Expand Down

0 comments on commit 98bf3ef

Please sign in to comment.