diff --git a/modules/blockfrost.nix b/modules/blockfrost.nix index 1ded497..0a99fad 100644 --- a/modules/blockfrost.nix +++ b/modules/blockfrost.nix @@ -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;}; }; diff --git a/modules/cardano.nix b/modules/cardano.nix index 3efec79..35302ad 100644 --- a/modules/cardano.nix +++ b/modules/cardano.nix @@ -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); diff --git a/modules/cli.nix b/modules/cli.nix index 985e945..94f26f5 100644 --- a/modules/cli.nix +++ b/modules/cli.nix @@ -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 { diff --git a/modules/db-sync.nix b/modules/db-sync.nix index 017bfb6..57997d0 100644 --- a/modules/db-sync.nix +++ b/modules/db-sync.nix @@ -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;}; }; diff --git a/modules/kupo.nix b/modules/kupo.nix index a735652..b1ab141 100644 --- a/modules/kupo.nix +++ b/modules/kupo.nix @@ -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 { diff --git a/modules/node.nix b/modules/node.nix index 11a0a79..3d8d2fd 100644 --- a/modules/node.nix +++ b/modules/node.nix @@ -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."; diff --git a/modules/ogmios.nix b/modules/ogmios.nix index 968fa70..1574b8e 100644 --- a/modules/ogmios.nix +++ b/modules/ogmios.nix @@ -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 { diff --git a/modules/oura.nix b/modules/oura.nix index 9f82ea7..581c71c 100644 --- a/modules/oura.nix +++ b/modules/oura.nix @@ -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''