Skip to content

Commit

Permalink
imp: fixup graphql-engine with package option
Browse files Browse the repository at this point in the history
  • Loading branch information
johnalotoski committed Feb 7, 2023
1 parent 402a13e commit 7bcd9bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions nix/cells/cardano-graphql/packages/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
let
inherit
(inputs)
self
std
nixpkgs
;
Expand All @@ -22,5 +23,7 @@ in {
cardano-graphql = nixpkgs.callPackage ./cardano-graphql.nix {
inherit filteredSrc;
};

graphql-engine = (import (self + "/nix/pkgs.nix") {inherit (nixpkgs) system;}).packages.graphql-engine;
persistgraphql = (nixpkgs.callPackage ./persistgraphql { nodejs = nixpkgs.nodejs-14_x; }).persistgraphql;
}
8 changes: 6 additions & 2 deletions nix/nixos/graphql-engine-service.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ in {
services.graphql-engine = {
enable = lib.mkEnableOption "graphql engine service";

package = lib.mkOption {
type = lib.types.package;
default = (import ../pkgs.nix {}).packages.graphql-engine;
};

host = lib.mkOption {
type = lib.types.str;
default = "";
Expand Down Expand Up @@ -44,7 +49,6 @@ in {
};
};
config = let
graphqlEngine = (import ../pkgs.nix {}).packages.graphql-engine;
hasuraDbPerms = pkgs.writeScript "hasuraDbPerms.sql" ''
CREATE EXTENSION IF NOT EXISTS pgcrypto;
CREATE SCHEMA IF NOT EXISTS hdb_catalog;
Expand Down Expand Up @@ -75,7 +79,7 @@ in {
sudo -u ${cfg.dbAdminUser} -- psql ${cfg.db} < ${hasuraDbPerms}
'';
script = ''
exec ${graphqlEngine}/bin/graphql-engine \
exec ${cfg.package}/bin/graphql-engine \
serve \
--server-port ${toString cfg.enginePort} \
--enable-telemetry=false \
Expand Down

0 comments on commit 7bcd9bd

Please sign in to comment.