Skip to content

Commit

Permalink
refactor: introduce packages/common.nix
Browse files Browse the repository at this point in the history
  • Loading branch information
thecaralice committed Oct 9, 2024
1 parent 1860bdb commit b112d2b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
9 changes: 9 additions & 0 deletions packages/common.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
rec {
version = "0.11.8";
src = {
owner = "devflowinc";
repo = "trieve";
rev = "v${version}";
hash = "sha256-4osska+/OTRPQyUxnBDb9m5+urbZSFwqV0HvIGIQPwM=";
};
}
12 changes: 5 additions & 7 deletions packages/frontends/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@
"search"
],
}:
let
common = import ../common.nix;
in
stdenv.mkDerivation rec {
pname = "trieve-frontends";
version = "0.11.8";
inherit (common) version;

src = fetchFromGitHub {
owner = "devflowinc";
repo = "trieve";
rev = "v${version}";
hash = "sha256-4osska+/OTRPQyUxnBDb9m5+urbZSFwqV0HvIGIQPwM=";
};
src = fetchFromGitHub common.src;
yarnOfflineCache = fetchYarnDeps {
yarnLock = "${src}/yarn.lock";
hash = "sha256-ZD5uCXrPblWrbUShllCA9wt2GTLQxGHdKeBLGVrM+lo=";
Expand Down
10 changes: 3 additions & 7 deletions packages/server/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
defaultReleaseProfile ? false,
}:
let
common = import ../common.nix;
swagger-ui = fetchurl rec {
pname = "swagger-ui";
version = "5.17.12";
Expand All @@ -20,13 +21,8 @@ let
};
commonArgs = rec {
pname = "trieve";
version = "0.11.8";
src = fetchFromGitHub {
owner = "devflowinc";
repo = "trieve";
rev = "v${version}";
hash = "sha256-4osska+/OTRPQyUxnBDb9m5+urbZSFwqV0HvIGIQPwM=";
};
inherit (common) version;
src = fetchFromGitHub common.src;
sourceRoot = "${src.name}/server";
strictDeps = true;
env.SWAGGER_UI_DOWNLOAD_URL = "file://${swagger-ui}";
Expand Down

0 comments on commit b112d2b

Please sign in to comment.