Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
35 changes: 17 additions & 18 deletions modules/blockfrost.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,24 @@
inherit (lib) mkIf mkMerge mkEnableOption;
in {
options.cardano.blockfrost = {
enable =
mkEnableOption ''
Blockfrost.io backend is an API service providing abstraction between you and Cardano blockchain data
enable = mkEnableOption ''
Blockfrost.io backend is an API service providing abstraction between you and Cardano blockchain data

Blockfrost connects to a postgresql database, populated by Cardano DB sync with node.
You need to either provide the db connection arguments:
```nix
services.blockfrost.settings.dbSync = {
# these are the defaults:
name = "cardano-db-sync";
user = "cardano-db-sync";
port = 5432;
# optionally supply "host" and "password" parameters.
socketdir = "/run/postgresql";
};
```
or enable the default postgresql service with `cardano.blockfrost.postgres.enable`
'';

Blockfrost connects to a postgresql database, populated by Cardano DB sync with node.
You need to either provide the db connection arguments:
```nix
services.blockfrost.settings.dbSync = {
# these are the defaults:
name = "cardano-db-sync";
user = "cardano-db-sync";
port = 5432;
# optionally supply "host" and "password" parameters.
socketdir = "/run/postgresql";
};
```
or enable the default postgresql service with `cardano.blockfrost.postgres.enable`
''
// {default = config.cardano.enable or false;};
postgres.enable = mkEnableOption "Connect blockfrost to local postgresql." // {default = true;};
};

Expand Down
1 change: 0 additions & 1 deletion modules/cardano.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
inherit (lib) types;
in {
options.cardano = {
enable = lib.mkEnableOption "all Cardano services and HTTP proxy";
network = lib.mkOption {
description = "Cardano network to operate on.";
type = types.enum (lib.attrNames cfg.networkNumbers);
Expand Down
2 changes: 1 addition & 1 deletion modules/cli.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
options.cardano.cli.enable = lib.mkOption {
description = "Add cardano-cli to 'environment.systemPackages'.";
type = lib.types.bool;
default = config.cardano.enable or config.cardano.node.enable or false;
default = config.cardano.node.enable or false;
};

config = lib.mkIf config.cardano.cli.enable {
Expand Down
33 changes: 16 additions & 17 deletions modules/db-sync.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,23 @@
inherit (lib) mkEnableOption mkIf mkMerge mkOptionDefault;
in {
options.cardano.db-sync = {
enable =
mkEnableOption ''
Cardano DB Sync provides a way to query local cardano node.
enable = mkEnableOption ''
Cardano DB Sync provides a way to query local cardano node.

Cardano DB sync connects to a cardano node and saves blocks to a database.
You need to either provide the db connection arguments:
```nix
services.cardano-db-sync.database = {
# these are the defaults:
name = "cardano-db-sync";
user = "cardano-db-sync";
port = 5432;
socketdir = "/run/postgresql";
};
```
or enable the default postgresql service with `services.cardano-db-sync.postgres.enable` and possibly overwrite the `services.postgresql` options for your need.
'';

Cardano DB sync connects to a cardano node and saves blocks to a database.
You need to either provide the db connection arguments:
```nix
services.cardano-db-sync.database = {
# these are the defaults:
name = "cardano-db-sync";
user = "cardano-db-sync";
port = 5432;
socketdir = "/run/postgresql";
};
```
or enable the default postgresql service with `services.cardano-db-sync.postgres.enable` and possibly overwrite the `services.postgresql` options for your need.
''
// {default = config.cardano.enable or false;};
postgres.enable = mkEnableOption "Run postgres and connect dbsync to it." // {default = true;};
};

Expand Down
3 changes: 1 addition & 2 deletions modules/kupo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
in {
options.cardano.kupo = {
enable =
lib.mkEnableOption "Kupo chain-indexer"
// {default = config.cardano.enable or false;};
lib.mkEnableOption "Kupo chain-indexer";
};

config = lib.mkIf cfg.enable {
Expand Down
4 changes: 1 addition & 3 deletions modules/node.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
inherit (builtins) elemAt match replaceStrings readFile;
in {
options.cardano.node = {
enable =
lib.mkEnableOption "cardano-node service"
// {default = config.cardano.enable or false;};
enable = lib.mkEnableOption "cardano-node service";

socketPath = lib.mkOption {
description = "Path to cardano-node socket.";
Expand Down
3 changes: 1 addition & 2 deletions modules/ogmios.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
in {
options.cardano.ogmios = {
enable =
lib.mkEnableOption "Ogmios bridge interface for cardano-node"
// {default = config.cardano.enable or false;};
lib.mkEnableOption "Ogmios bridge interface for cardano-node";
};

config = lib.mkIf cfg.enable {
Expand Down
3 changes: 1 addition & 2 deletions modules/oura.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
in {
options.cardano.oura = {
enable =
lib.mkEnableOption "Oura"
// {default = config.cardano.enable or false;};
lib.mkEnableOption "Oura event processing pipeline for Cardano";

integrate =
lib.mkEnableOption ''connect oura to local cardano-node via N2C''
Expand Down