Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👷 Implement changes for flake based deployment #456

Merged
merged 8 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ];
rroohhh marked this conversation as resolved.
Show resolved Hide resolved
};
} //
(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
Loading