Skip to content

Commit 68bc427

Browse files
committed
refactor: Switch db-sync to use cardano.providers
Signed-off-by: Alexander V. Nikolaev <[email protected]>
1 parent cf0618a commit 68bc427

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

modules/db-sync.nix

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ in
4646
services.cardano-db-sync = {
4747
enable = true;
4848
environment = config.services.cardano-node.environments.${config.cardano.network};
49-
inherit (config.cardano.node) socketPath;
49+
inherit (config.cardano.providers.node) socketPath;
5050
postgres = {
5151
user = "cardano-db-sync";
5252
# use first socket from postgresql settings or default to /run/postgresql
@@ -59,6 +59,8 @@ in
5959
systemd.services.cardano-db-sync = {
6060
serviceConfig = {
6161
User = "cardano-db-sync";
62+
# Default db-sync service hardcode "cardano-node"
63+
SupplementaryGroups = config.cardano.providers.node.accessGroup;
6264
# Security
6365
UMask = "0077";
6466
CapabilityBoundingSet = "";
@@ -90,10 +92,10 @@ in
9092
};
9193
};
9294
})
93-
(mkIf (cfg.enable && config.cardano.node.enable or false) {
95+
(mkIf (cfg.enable && config.cardano.providers.node.active) {
9496
systemd.services.cardano-db-sync = {
95-
after = [ "cardano-node-socket.service" ];
96-
requires = [ "cardano-node-socket.service" ];
97+
after = [ config.cardano.providers.node.after ];
98+
requires = [ config.cardano.providers.node.requires ];
9799
};
98100
})
99101
(mkIf (cfg.enable && cfg.postgres.enable) {

0 commit comments

Comments
 (0)