From 24c9c00627cd97f89fc4ca35b6cb79af41e8e330 Mon Sep 17 00:00:00 2001 From: dzmitry-lahoda Date: Sun, 17 Mar 2024 15:59:55 +0000 Subject: [PATCH 01/10] fixing gaia --- lib/default.nix | 26 ++ modules/nixosModules.nix | 11 + modules/packages.nix | 6 + nixosModules/hermes/chain-options.nix | 255 ++++++++++++ nixosModules/hermes/default.nix | 44 +++ nixosModules/hermes/options.nix | 246 ++++++++++++ nixosModules/relayer/hermes-toml.nix | 84 ---- nixosModules/relayer/hermes.nix | 418 -------------------- nixosTests/tests/hermes-test.nix | 59 ++- nixosTests/tests/validator1/config/app.toml | 2 +- nixosTests/tests/validator2/config/app.toml | 2 +- packages/hermes.nix | 3 + 12 files changed, 634 insertions(+), 522 deletions(-) create mode 100644 modules/nixosModules.nix create mode 100644 nixosModules/hermes/chain-options.nix create mode 100644 nixosModules/hermes/default.nix create mode 100644 nixosModules/hermes/options.nix delete mode 100644 nixosModules/relayer/hermes-toml.nix delete mode 100644 nixosModules/relayer/hermes.nix diff --git a/lib/default.nix b/lib/default.nix index f2af0d93..cbfce349 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -168,4 +168,30 @@ in { gomod2nix --outdir "$CURDIR" ''; }; + hermesModuleConfigToml = {modules}: + pkgs.lib.evalModules { + modules = + [ + ( + { + lib, + config, + ... + }: let + prev = config.hermes; + cfg = prev // {chains = builtins.map (pkgs.lib.filterAttrsRecursive (_: v: v != null)) prev.chains;}; + hermes-toml = nix-std.lib.serde.toTOML (builtins.removeAttrs cfg ["toml"]); + in + with lib; { + options.hermes = + (import ../nixosModules/relayer/options.nix {inherit lib;}) + // { + toml = mkOption {type = types.unique {message = "only one toml output";} types.str;}; + }; + config.hermes.toml = hermes-toml; + } + ) + ] + ++ modules; + }; } diff --git a/modules/nixosModules.nix b/modules/nixosModules.nix new file mode 100644 index 00000000..7ae9b98d --- /dev/null +++ b/modules/nixosModules.nix @@ -0,0 +1,11 @@ +{ + inputs, + hermes, + ... +}: let + std = inputs.nix-std; +in { + flake.nixosModules = { + hermes = import ../../nixosModules/hermes/default.nix {inherit nix-std hermes;}; + }; +} diff --git a/modules/packages.nix b/modules/packages.nix index 4f202e3a..0c66e748 100644 --- a/modules/packages.nix +++ b/modules/packages.nix @@ -77,6 +77,12 @@ inherit pkgs; inherit (inputs) hermes-src; }; + hermes-test = import ../nixosTests/tests/hermes-test.nix { + inherit pkgs; + inherit (inputs) nix-std; + inherit (self'.packages) hermes; + gaia = self'.packages.gaia14; + }; ica = import ../packages/ica.nix { inherit (pkgs) buildGoModule; inherit (inputs) ica-src; diff --git a/nixosModules/hermes/chain-options.nix b/nixosModules/hermes/chain-options.nix new file mode 100644 index 00000000..7cb15f09 --- /dev/null +++ b/nixosModules/hermes/chain-options.nix @@ -0,0 +1,255 @@ +{lib}: +with lib; { + # Required + id = mkOption { + type = types.str; + description = '' + Specify the chain ID. + ''; + }; + rpc_addr = mkOption { + type = types.str; + description = '' + Specify the RPC address and port where the chain RPC server listens on. + ''; + }; + grpc_addr = mkOption { + type = types.str; + description = '' + Specify the GRPC address and port where the chain GRPC server listens on. + ''; + }; + + event_source = mkOption { + type = types.submodule { + options = { + mode = mkOption { + type = types.enum ["push" "pull"]; + default = "push"; + description = '' + Specify the mode of the event source. + ''; + }; + url = mkOption { + type = types.nullOr types.str; + default = null; + description = '' + Specify the WebSocket address and port where the chain WebSocket server listens on. + ''; + }; + batch_delay = mkOption { + type = types.nullOr types.str; + default = null; + description = '' + Specify the delay between batches of events. + ''; + }; + interval = mkOption { + type = types.nullOr types.str; + default = null; + + description = '' + Specify the interval between requests for new events. + ''; + }; + }; + }; + }; + + account_prefix = mkOption { + type = types.str; + description = '' + Specify the prefix used by the chain. + ''; + }; + key_name = mkOption { + type = types.str; + description = '' + Specify the name of the private key to use for signing transactions. Required + + See the Adding Keys chapter + . + ''; + }; + key_store_type = mkOption { + type = types.enum ["Test" "Memory"]; + default = "Test"; + }; + default_gas = mkOption { + type = types.ints.positive; + default = 100000000; + }; + gas_price = mkOption { + type = types.submodule { + options = { + price = mkOption { + type = types.float; + description = '' + Specify the price per gas used of the fee to submit a transaction. + ''; + }; + denom = mkOption { + type = types.str; + description = '' + Specify the denomination of the fee to submit a transaction. + ''; + }; + }; + }; + }; + + address_type = mkOption { + type = types.submodule { + options = { + derivation = mkOption { + type = types.enum ["cosmos"]; + default = "cosmos"; + description = '' + Specify the derivation type of the address. + ''; + }; + }; + }; + }; + + packet_filter = mkOption { + default = { + policy = "allow"; + list = [["*" "*"]]; + }; + type = types.submodule { + options = { + policy = mkOption { + type = types.enum ["allow" "deny"]; + default = "allow"; + description = '' + Specify the policy of the packet filter. + ''; + }; + list = mkOption { + type = types.listOf (types.listOf types.str); + default = [["*" "*"]]; + description = '' + Specify the list of packet filters. + ''; + }; + }; + }; + }; + + # Optional + rpc_timeout = mkOption { + type = types.str; + default = "10s"; + description = '' + Specify the maximum amount of time (duration) that the RPC requests should + take before timing out. + ''; + }; + store_prefix = mkOption { + type = types.str; + default = "ibc"; + description = '' + Specify the store prefix used by the on-chain IBC modules. + ''; + }; + max_gas = mkOption { + type = types.ints.positive; + default = 3000000; + description = '' + Specify the maximum amount of gas to be used as the gas limit for a transaction. + ''; + }; + gas_multiplier = mkOption { + type = types.float; + default = 0.1; + description = '' + Specify by ratio to increase the gas estimate used to compute the fee, + to account for potential estimation error. + ''; + }; + max_msg_num = mkOption { + type = types.ints.positive; + default = 30; + description = '' + Specify how many IBC messages at most to include in a single transaction. + ''; + }; + max_tx_size = mkOption { + type = types.ints.positive; + default = 2097152; + description = '' + Specify the maximum size, in bytes, of each transaction that Hermes will submit. + ''; + }; + max_block_time = mkOption { + type = types.str; + default = "30s"; + description = '' + Specify the maximum amount of time to wait for a new block to be committed. + ''; + }; + clock_drift = mkOption { + type = types.str; + default = "5s"; + description = '' + Specify the maximum amount of time to tolerate a clock drift. + The clock drift parameter defines how much new (untrusted) header's time + can drift into the future. + ''; + }; + trusting_period = mkOption { + type = types.str; + default = "14days"; + description = '' + Specify the amount of time to be used as the light client trusting period. + It should be significantly less than the unbonding period + (e.g. unbonding period = 3 weeks, trusting period = 2 weeks). + ''; + }; + trusted_node = mkOption { + type = types.bool; + default = false; + }; + ccv_consumer_chain = mkOption { + type = types.bool; + default = false; + }; + + type = mkOption { + type = types.enum ["CosmosSdk"]; + default = "CosmosSdk"; + description = '' + Specify the type of the chain. + ''; + }; + + trust_threshold = mkOption { + default = { + numerator = "1"; + denominator = "3"; + }; + type = types.submodule { + options = { + numerator = mkOption { + type = types.str; + default = "1"; + description = '' + Specify the trust threshold for the light client, ie. the maximum fraction of validators + which have changed between two blocks. + Warning: This is an advanced feature! Modify with caution. + ''; + }; + denominator = mkOption { + type = types.str; + default = "3"; + description = '' + Specify the trust threshold for the light client, ie. the maximum fraction of validators + which have changed between two blocks. + Warning: This is an advanced feature! Modify with caution. + ''; + }; + }; + }; + }; +} diff --git a/nixosModules/hermes/default.nix b/nixosModules/hermes/default.nix new file mode 100644 index 00000000..a84c5451 --- /dev/null +++ b/nixosModules/hermes/default.nix @@ -0,0 +1,44 @@ +{ + nix-std ? import (fetchTarball "https://github.com/chessai/nix-std/archive/master.tar.gz"), + hermes, +}: { + lib, + config, + pkgs, + ... +}: let + hermes-path = lib.meta.getExe hermes; + prev = config.services.hermes; + cfg = prev // {chains = builtins.map (pkgs.lib.filterAttrsRecursive (_: v: v != null)) prev.chains;}; + hermes-toml = pkgs.writeTextFile { + text = nix-std.lib.serde.toTOML cfg; + name = "config.toml"; + }; +in + with lib; { + options.services.hermes = + import ./options.nix {inherit lib;} + // { + enable = mkEnableOption "hermes"; + package = mkOption { + type = types.str; + default = hermes-path; + description = '' + The hermes (ibc-rs) software to run. + ''; + }; + }; + + config = mkIf cfg.enable { + systemd.services.hermes = { + description = "Hermes Daemon"; + wantedBy = ["multi-user.target"]; + after = ["network.target"]; + preStart = "echo \"hermes toml can be found here: ${hermes-toml}\""; + serviceConfig = { + Type = "notify"; + ExecStart = "${cfg.package} -c ${hermes-toml} start"; + }; + }; + }; + } diff --git a/nixosModules/hermes/options.nix b/nixosModules/hermes/options.nix new file mode 100644 index 00000000..0f7e2fe6 --- /dev/null +++ b/nixosModules/hermes/options.nix @@ -0,0 +1,246 @@ +{lib}: +with lib; { + global = mkOption { + type = types.submodule { + options = { + log_level = mkOption { + type = types.enum ["error" "warn" "info" "debug" "trace"]; + default = "info"; + description = '' + Specify the verbosity for the relayer logging output. + ''; + }; + }; + }; + }; + mode = mkOption { + description = "Specify the mode to be used by the relayer"; + default = { + clients = { + enabled = true; + refresh = true; + misbehaviour = true; + }; + packets = { + enabled = true; + clear_interval = 100; + clear_on_start = false; + tx_confirmation = true; + }; + connections.enabled = false; + channels.enabled = false; + }; + type = types.submodule { + options = { + clients = mkOption { + description = "Specify the clients mode"; + default = { + enabled = true; + refresh = true; + misbehaviour = true; + }; + type = types.submodule { + options = { + enabled = mkOption { + type = types.bool; + default = true; + description = '' + Whether or not to enable the client workers. + ''; + }; + refresh = mkOption { + type = types.bool; + default = true; + description = '' + Whether or not to enable periodic refresh of clients. [Default: true] + Note: Even if this is disabled, clients will be refreshed automatically if + there is activity on a connection or channel they are involved with. + ''; + }; + misbehaviour = mkOption { + type = types.bool; + default = true; + description = '' + Whether or not to enable misbehaviour detection for clients. + ''; + }; + }; + }; + }; + + packets = mkOption { + description = "Specify the packets mode"; + default = { + enabled = true; + clear_interval = 100; + clear_on_start = false; + tx_confirmation = true; + }; + type = types.submodule { + options = { + enabled = mkOption { + type = types.bool; + default = true; + description = '' + Whether or not to enable the packet workers. + ''; + }; + clear_interval = mkOption { + type = types.ints.u32; + default = 100; + description = '' + Parametrize the periodic packet clearing feature. + Interval (in number of blocks) at which pending packets + should be eagerly cleared. A value of '0' will disable it. + ''; + }; + clear_on_start = mkOption { + type = types.bool; + default = false; + description = '' + Whether or not to clear packets on start. + ''; + }; + tx_confirmation = mkOption { + type = types.bool; + default = true; + description = '' + Toggle the transaction confirmation mechanism. + The tx confirmation mechanism periodically queries the `/tx_search` RPC + endpoint to check that previously-submitted transactions + (to any chain in this config file) have delivered successfully. + Experimental feature. Affects telemetry if set to false. + ''; + }; + }; + }; + }; + + connections = mkOption { + description = "Specify the connections mode"; + default = { + enabled = false; + }; + type = types.submodule { + options = { + enabled = mkOption { + type = types.bool; + default = true; + description = '' + Whether or not to enable the connection workers for handshake completion. + ''; + }; + }; + }; + }; + + channels = mkOption { + description = "Specify the channels mode"; + default = { + enabled = false; + }; + type = types.submodule { + options = { + enabled = mkOption { + type = types.bool; + default = true; + description = '' + Whether or not to enable the channel workers for handshake completion. + ''; + }; + }; + }; + }; + }; + }; + }; + + # REST API submodule options + rest = mkOption { + description = '' + The REST section defines parameters for Hermes' built-in RESTful API. + Rest option docs. + ''; + default = { + enabled = true; + host = "127.0.0.1"; + port = 3000; + }; + type = types.submodule { + options = { + enabled = mkOption { + type = types.bool; + default = true; + description = '' + Where or not to enable the REST service. + ''; + }; + host = mkOption { + type = types.str; + default = "127.0.0.1"; + description = '' + Specify the IPv4/6 host over which the built-in HTTP server will serve the RESTful. + ''; + }; + port = mkOption { + type = types.port; + default = 3000; + description = '' + Specify the port over which the built-in HTTP server will serve the restful API. + ''; + }; + }; + }; + }; + + # Telemetry API submodule options + telemetry = mkOption { + description = '' + The telemetry section defines parameters for Hermes' built-in telemetry capabilities. + Telemetry option docs. + ''; + default = { + enabled = true; + host = "127.0.0.1"; + port = 3001; + }; + type = types.submodule { + options = { + enabled = mkOption { + type = types.bool; + default = true; + description = '' + Whether or not to enable the telemetry service. + ''; + }; + host = mkOption { + type = types.str; + default = "127.0.0.1"; + description = '' + Specify the IPv4/6 host over which the built-in HTTP server will serve metrics. + ''; + }; + port = mkOption { + type = types.port; + default = 3001; + description = '' + Specify the port over which the built-in HTTP server will serve the metrics gathered. + ''; + }; + }; + }; + }; + + # Chain submodule options + chains = mkOption { + description = '' + A chains section includes parameters related to a chain and the full node to which + the relayer can send transactions and queries. + ''; + type = types.listOf ( + types.submodule { + options = import ./chain-options.nix {inherit lib;}; + } + ); + }; +} diff --git a/nixosModules/relayer/hermes-toml.nix b/nixosModules/relayer/hermes-toml.nix deleted file mode 100644 index b8d93a33..00000000 --- a/nixosModules/relayer/hermes-toml.nix +++ /dev/null @@ -1,84 +0,0 @@ -{ - pkgs, - cfg, -}: -with cfg; let - boolToString = bool: - if bool - then "true" - else "false"; - rest = with cfg.rest; - with builtins; '' - [rest] - enabled = ${boolToString enabled} - host = '${host}' - port = ${toString port} - ''; - - telemetry = with cfg.telemetry; '' - [telemetry] - enabled = ${boolToString enabled} - host = '${host}' - port = ${toString port} - ''; - - chain-fold-op = accumulator: chain: - with chain; - accumulator - + '' - [[chains]] - id = '${id}' - rpc_addr = '${rpc-address}' - grpc_addr = '${grpc-address}' - websocket_addr = '${websocket-address}' - rpc_timeout = '${toString rpc-timeout}' - account_prefix = '${account-prefix}' - key_name = '${key-name}' - store_prefix = '${store-prefix}' - max_gas = ${toString max-gas} - gas_price = { price = ${toString gas-price}, denom = '${toString gas-denomination}' } - gas_adjustment = ${toString gas-adjustment} - max_msg_num = ${toString max-message-number} - max_tx_size = ${toString max-transaction-size} - clock_drift = '${clock-drift}' - trusting_period = '${trusting-period}' - trust_threshold = { numerator = '${toString trust-threshold-numerator}', denominator = '${toString trust-threshold-denominator}' } - ''; - chains = builtins.foldl' chain-fold-op "" cfg.chains; - mode = with cfg.mode; '' - [mode] - - [mode.clients] - enabled = ${boolToString clients.enabled} - refresh = ${boolToString clients.refresh} - misbehaviour = ${boolToString clients.misbehaviour} - - [mode.connections] - enabled = ${boolToString connections.enabled} - - [mode.channels] - enabled = ${boolToString channels.enabled} - - [mode.packets] - enabled = ${boolToString packets.enabled} - clear_interval = ${toString packets.clear-interval} - clear_on_start = ${boolToString packets.clear-on-start} - tx_confirmation = ${boolToString packets.tx-confirmation} - ''; -in - pkgs.writeTextFile { - name = "config.toml"; - text = - '' - [global] - log_level = '${log-level}' - '' - + "\n" - + mode - + "\n" - + rest - + "\n" - + telemetry - + "\n" - + chains; - } diff --git a/nixosModules/relayer/hermes.nix b/nixosModules/relayer/hermes.nix deleted file mode 100644 index c89bb7bf..00000000 --- a/nixosModules/relayer/hermes.nix +++ /dev/null @@ -1,418 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - cfg = config.services.hermes; - hermes-toml = (import ./hermes-toml.nix) {inherit pkgs cfg;}; -in - with lib; { - options.services.hermes = { - enable = mkEnableOption "hermes"; - package = mkOption { - type = types.package; - default = pkgs.hermes; - description = '' - The hermes (ibc-rs) software to run. - ''; - }; - log-level = mkOption { - type = types.enum ["error" "warn" "info" "debug" "trace"]; - default = "info"; - description = '' - Specify the verbosity for the relayer logging output. - ''; - }; - - mode = mkOption { - description = "Specify the mode to be used by the relayer"; - default = { - clients = { - enabled = true; - refresh = true; - misbehaviour = true; - }; - packets = { - enabled = true; - clear-interval = 100; - clear-on-start = false; - tx-confirmation = true; - }; - connections.enabled = false; - channels.enabled = false; - }; - type = types.submodule { - options = { - clients = mkOption { - description = "Specify the clients mode"; - default = { - enabled = true; - refresh = true; - misbehaviour = true; - }; - type = types.submodule { - options = { - enabled = mkOption { - type = types.bool; - default = true; - description = '' - Whether or not to enable the client workers. - ''; - }; - refresh = mkOption { - type = types.bool; - default = true; - description = '' - Whether or not to enable periodic refresh of clients. [Default: true] - Note: Even if this is disabled, clients will be refreshed automatically if - there is activity on a connection or channel they are involved with. - ''; - }; - misbehaviour = mkOption { - type = types.bool; - default = true; - description = '' - Whether or not to enable misbehaviour detection for clients. - ''; - }; - }; - }; - }; - - packets = mkOption { - description = "Specify the packets mode"; - default = { - enabled = true; - clear-interval = 100; - clear-on-start = false; - tx-confirmation = true; - }; - type = types.submodule { - options = { - enabled = mkOption { - type = types.bool; - default = true; - description = '' - Whether or not to enable the packet workers. - ''; - }; - clear-interval = mkOption { - type = types.ints.u32; - default = 100; - description = '' - Parametrize the periodic packet clearing feature. - Interval (in number of blocks) at which pending packets - should be eagerly cleared. A value of '0' will disable it. - ''; - }; - clear-on-start = mkOption { - type = types.bool; - default = false; - description = '' - Whether or not to clear packets on start. - ''; - }; - tx-confirmation = mkOption { - type = types.bool; - default = true; - description = '' - Toggle the transaction confirmation mechanism. - The tx confirmation mechanism periodically queries the `/tx_search` RPC - endpoint to check that previously-submitted transactions - (to any chain in this config file) have delivered successfully. - Experimental feature. Affects telemetry if set to false. - ''; - }; - }; - }; - }; - - connections = mkOption { - description = "Specify the connections mode"; - default = { - enabled = false; - }; - type = types.submodule { - options = { - enabled = mkOption { - type = types.bool; - default = true; - description = '' - Whether or not to enable the connection workers for handshake completion. - ''; - }; - }; - }; - }; - - channels = mkOption { - description = "Specify the channels mode"; - default = { - enabled = false; - }; - type = types.submodule { - options = { - enabled = mkOption { - type = types.bool; - default = true; - description = '' - Whether or not to enable the channel workers for handshake completion. - ''; - }; - }; - }; - }; - }; - }; - }; - tx-confirmation = mkOption { - type = types.bool; - default = true; - description = '' - Toggle the transaction confirmation mechanism. - The tx confirmation mechanism periodically queries the `/tx_search` RPC - endpoint to check that previously-submitted transactions - (to any chain in this config file) have delivered successfully. - Experimental feature. Affects telemetry if set to false. - ''; - }; - - # REST API submodule options - rest = mkOption { - description = '' - The REST section defines parameters for Hermes' built-in RESTful API. - Rest option docs. - ''; - default = { - enabled = true; - host = "127.0.0.1"; - port = 3000; - }; - type = types.submodule { - options = { - enabled = mkOption { - type = types.bool; - default = true; - description = '' - Where or not to enable the REST service. - ''; - }; - host = mkOption { - type = types.str; - default = "127.0.0.1"; - description = '' - Specify the IPv4/6 host over which the built-in HTTP server will serve the RESTful. - ''; - }; - port = mkOption { - type = types.port; - default = 3000; - description = '' - Specify the port over which the built-in HTTP server will serve the restful API. - ''; - }; - }; - }; - }; - - # Telemetry API submodule options - telemetry = mkOption { - description = '' - The telemetry section defines parameters for Hermes' built-in telemetry capabilities. - Telemetry option docs. - ''; - default = { - enabled = true; - host = "127.0.0.1"; - port = 3001; - }; - type = types.submodule { - options = { - enabled = mkOption { - type = types.bool; - default = true; - description = '' - Whether or not to enable the telemetry service. - ''; - }; - host = mkOption { - type = types.str; - default = "127.0.0.1"; - description = '' - Specify the IPv4/6 host over which the built-in HTTP server will serve metrics. - ''; - }; - port = mkOption { - type = types.port; - default = 3001; - description = '' - Specify the port over which the built-in HTTP server will serve the metrics gathered. - ''; - }; - }; - }; - }; - - # Chain submodule options - chains = mkOption { - description = '' - A chains section includes parameters related to a chain and the full node to which - the relayer can send transactions and queries. - ''; - type = types.listOf ( - types.submodule { - options = { - # Required - id = mkOption { - type = types.str; - description = '' - Specify the chain ID. - ''; - }; - rpc-address = mkOption { - type = types.str; - description = '' - Specify the RPC address and port where the chain RPC server listens on. - ''; - }; - grpc-address = mkOption { - type = types.str; - description = '' - Specify the GRPC address and port where the chain GRPC server listens on. - ''; - }; - websocket-address = mkOption { - type = types.str; - description = '' - Specify the WebSocket address and port where the chain WebSocket server listens on. - ''; - }; - account-prefix = mkOption { - type = types.str; - description = '' - Specify the prefix used by the chain. - ''; - }; - key-name = mkOption { - type = types.str; - description = '' - Specify the name of the private key to use for signing transactions. Required - - See the Adding Keys chapter - . - ''; - }; - gas-price = mkOption { - type = types.float; - description = '' - Specify the price per gas used of the fee to submit a transaction. - ''; - }; - gas-denomination = mkOption { - type = types.str; - description = '' - Specify the denomination of the fee to submit a transaction. - ''; - }; - - # Optional - rpc-timeout = mkOption { - type = types.str; - default = "10s"; - description = '' - Specify the maximum amount of time (duration) that the RPC requests should - take before timing out. - ''; - }; - store-prefix = mkOption { - type = types.str; - default = "ibc"; - description = '' - Specify the store prefix used by the on-chain IBC modules. - ''; - }; - max-gas = mkOption { - type = types.ints.positive; - default = 3000000; - description = '' - Specify the maximum amount of gas to be used as the gas limit for a transaction. - ''; - }; - gas-adjustment = mkOption { - type = types.float; - default = 0.1; - description = '' - Specify by ratio to increase the gas estimate used to compute the fee, - to account for potential estimation error. - ''; - }; - max-message-number = mkOption { - type = types.ints.positive; - default = 30; - description = '' - Specify how many IBC messages at most to include in a single transaction. - ''; - }; - max-transaction-size = mkOption { - type = types.ints.positive; - default = 2097152; - description = '' - Specify the maximum size, in bytes, of each transaction that Hermes will submit. - ''; - }; - clock-drift = mkOption { - type = types.str; - default = "5s"; - description = '' - Specify the maximum amount of time to tolerate a clock drift. - The clock drift parameter defines how much new (untrusted) header's time - can drift into the future. - ''; - }; - trusting-period = mkOption { - type = types.str; - default = "14days"; - description = '' - Specify the amount of time to be used as the light client trusting period. - It should be significantly less than the unbonding period - (e.g. unbonding period = 3 weeks, trusting period = 2 weeks). - ''; - }; - trust-threshold-numerator = mkOption { - type = types.ints.positive; - default = 1; - description = '' - Specify the trust threshold for the light client, ie. the maximum fraction of validators - which have changed between two blocks. - Warning: This is an advanced feature! Modify with caution. - ''; - }; - trust-threshold-denominator = mkOption { - type = types.ints.positive; - default = 3; - description = '' - Specify the trust threshold for the light client, ie. the maximum fraction of validators - which have changed between two blocks. - Warning: This is an advanced feature! Modify with caution. - ''; - }; - }; - } - ); - }; - }; - - config = mkIf cfg.enable { - systemd.services.hermes = { - description = "Hermes Daemon"; - wantedBy = ["multi-user.target"]; - after = ["network.target"]; - preStart = "echo \"hermes toml can be found here: ${hermes-toml}\""; - serviceConfig = { - Type = "notify"; - ExecStart = "${cfg.package}/bin/hermes -c ${hermes-toml} start"; - }; - }; - }; - } diff --git a/nixosTests/tests/hermes-test.nix b/nixosTests/tests/hermes-test.nix index 8bca31d8..d8e123b3 100644 --- a/nixosTests/tests/hermes-test.nix +++ b/nixosTests/tests/hermes-test.nix @@ -1,5 +1,6 @@ { pkgs, + nix-std, hermes, gaia, }: let @@ -16,7 +17,10 @@ in name = "hermes-module-test"; nodes = { validator1 = { - imports = [sharedModule ../../nixosModules/chains/gaia.nix]; + imports = [ + sharedModule + ../../nixosModules/chains/gaia.nix + ]; networking = { interfaces = { eth1 = { @@ -45,7 +49,10 @@ in }; validator2 = { - imports = [sharedModule ../chains/gaia.nix]; + imports = [ + sharedModule + ../../nixosModules/chains/gaia.nix + ]; networking = { interfaces = { eth1 = { @@ -93,7 +100,10 @@ in }; relayer = { - imports = [sharedModule ../../nixosModules/relayer/hermes.nix]; + imports = [ + sharedModule + (import ../../nixosModules/hermes/default.nix {inherit nix-std hermes;}) + ]; networking = { interfaces.eth1 = { @@ -116,7 +126,8 @@ in services.hermes = { enable = true; - package = hermes; + global.log_level = "trace"; + # package = hermes; rest = { port = defaultRestPort; host = "0.0.0.0"; @@ -128,23 +139,35 @@ in chains = [ { id = "nixos"; - rpc-address = "http://validator1:26657"; - grpc-address = "http://validator1:9090"; - websocket-address = "ws://validator1:26657/websocket"; - account-prefix = "cosmos"; - key-name = "testkey"; - gas-price = 0.001; - gas-denomination = "stake"; + rpc_addr = "http://validator1:26657"; + grpc_addr = "http://validator1:9090"; + account_prefix = "cosmos"; + address_type = {derivation = "cosmos";}; + key_name = "testkey"; + gas_price = { + price = 0.001; + denom = "stake"; + }; + event_source = { + mode = "pull"; + interval = "1s"; + }; } { id = "nixos2"; - rpc-address = "http://validator2:26657"; - grpc-address = "http://validator2:9090"; - websocket-address = "ws://validator2:26657/websocket"; - account-prefix = "cosmos"; - key-name = "testkey"; - gas-price = 0.001; - gas-denomination = "stake"; + rpc_addr = "http://validator2:26657"; + grpc_addr = "http://validator2:9090"; + account_prefix = "cosmos"; + address_type = {derivation = "cosmos";}; + key_name = "testkey"; + gas_price = { + price = 0.001; + denom = "stake"; + }; + event_source = { + mode = "pull"; + interval = "1s"; + }; } ]; }; diff --git a/nixosTests/tests/validator1/config/app.toml b/nixosTests/tests/validator1/config/app.toml index ad45a808..56e9b7b6 100644 --- a/nixosTests/tests/validator1/config/app.toml +++ b/nixosTests/tests/validator1/config/app.toml @@ -8,7 +8,7 @@ # The minimum gas prices a validator is willing to accept for processing a # transaction. A transaction's fees must meet the minimum of any denomination # specified in this config (e.g. 0.25token1;0.0001token2). -minimum-gas-prices = "" +minimum-gas-prices = "0.001stake" # default: the last 100 states are kept in addition to every 500th state; pruning at 10 block intervals # nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node) diff --git a/nixosTests/tests/validator2/config/app.toml b/nixosTests/tests/validator2/config/app.toml index ad45a808..56e9b7b6 100644 --- a/nixosTests/tests/validator2/config/app.toml +++ b/nixosTests/tests/validator2/config/app.toml @@ -8,7 +8,7 @@ # The minimum gas prices a validator is willing to accept for processing a # transaction. A transaction's fees must meet the minimum of any denomination # specified in this config (e.g. 0.25token1;0.0001token2). -minimum-gas-prices = "" +minimum-gas-prices = "0.001stake" # default: the last 100 states are kept in addition to every 500th state; pruning at 10 block intervals # nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node) diff --git a/packages/hermes.nix b/packages/hermes.nix index 485df873..abe4b2fc 100644 --- a/packages/hermes.nix +++ b/packages/hermes.nix @@ -15,4 +15,7 @@ pkgs.rustPlatform.buildRustPackage { ]; cargoSha256 = "sha256-oAsRn0THb5FU1HqgpB60jChGeQZdbrPoPfzTbyt3ozM="; doCheck = false; + meta = { + mainProgram = "hermes"; + }; } From 0c676b138f361b0849c96d3ae7dd1f2af1caff78 Mon Sep 17 00:00:00 2001 From: dzmitry-lahoda Date: Sun, 17 Mar 2024 16:02:26 +0000 Subject: [PATCH 02/10] fixing toml generator --- lib/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/default.nix b/lib/default.nix index cbfce349..fe2b1b9a 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -184,7 +184,7 @@ in { in with lib; { options.hermes = - (import ../nixosModules/relayer/options.nix {inherit lib;}) + (import ../nixosModules/hermes/options.nix {inherit lib;}) // { toml = mkOption {type = types.unique {message = "only one toml output";} types.str;}; }; From 9b6e23c3a2a306a058d7cf6400b05b1afe9d0a84 Mon Sep 17 00:00:00 2001 From: dzmitry-lahoda Date: Sun, 17 Mar 2024 16:23:43 +0000 Subject: [PATCH 03/10] fixing mac --- modules/packages.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/packages.nix b/modules/packages.nix index 47b4c84f..f1dde3ff 100644 --- a/modules/packages.nix +++ b/modules/packages.nix @@ -77,12 +77,12 @@ inherit pkgs; inherit (inputs) hermes-src; }; - hermes-test = import ../nixosTests/tests/hermes-test.nix { + hermes-test = pkgs.lib.optionalAttrs pkgs.stdenv.isLinux (import ../nixosTests/tests/hermes-test.nix { inherit pkgs; inherit (inputs) nix-std; inherit (self'.packages) hermes; gaia = self'.packages.gaia14; - }; + }); ica = import ../packages/ica.nix { inherit (pkgs) buildGoModule; inherit (inputs) ica-src; From afaf1354e58f8f039d40c4ee8b7d182253b71a54 Mon Sep 17 00:00:00 2001 From: dzmitry-lahoda Date: Sun, 17 Mar 2024 16:28:06 +0000 Subject: [PATCH 04/10] fixed mac again --- modules/packages.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/packages.nix b/modules/packages.nix index f1dde3ff..d9ab713e 100644 --- a/modules/packages.nix +++ b/modules/packages.nix @@ -77,12 +77,6 @@ inherit pkgs; inherit (inputs) hermes-src; }; - hermes-test = pkgs.lib.optionalAttrs pkgs.stdenv.isLinux (import ../nixosTests/tests/hermes-test.nix { - inherit pkgs; - inherit (inputs) nix-std; - inherit (self'.packages) hermes; - gaia = self'.packages.gaia14; - }); ica = import ../packages/ica.nix { inherit (pkgs) buildGoModule; inherit (inputs) ica-src; @@ -214,6 +208,14 @@ inherit (inputs) apalache-src; }; } + { + hermes-test = import ../nixosTests/tests/hermes-test.nix { + inherit pkgs; + inherit (inputs) nix-std; + inherit (self'.packages) hermes; + gaia = self'.packages.gaia14; + }; + } { stargaze = import ../packages/stargaze.nix { inherit (inputs) stargaze-src; From 706a63493fc66c08dc952f103ac3f48a530c6095 Mon Sep 17 00:00:00 2001 From: dzmitry-lahoda Date: Sun, 17 Mar 2024 16:35:56 +0000 Subject: [PATCH 05/10] no config builder for cosmos-sdk now --- modules/packages.nix | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/modules/packages.nix b/modules/packages.nix index d9ab713e..894c0e11 100644 --- a/modules/packages.nix +++ b/modules/packages.nix @@ -208,14 +208,15 @@ inherit (inputs) apalache-src; }; } - { - hermes-test = import ../nixosTests/tests/hermes-test.nix { - inherit pkgs; - inherit (inputs) nix-std; - inherit (self'.packages) hermes; - gaia = self'.packages.gaia14; - }; - } + # fails with gaia nill pointer, so need to have config builder for cosmos-sdk too + # { + # hermes-test = import ../nixosTests/tests/hermes-test.nix { + # inherit pkgs; + # inherit (inputs) nix-std; + # inherit (self'.packages) hermes; + # gaia = self'.packages.gaia14; + # }; + # } { stargaze = import ../packages/stargaze.nix { inherit (inputs) stargaze-src; From 1f10b0b6c772b98cb1accf335d10b3277a561b0a Mon Sep 17 00:00:00 2001 From: dzmitry-lahoda Date: Mon, 18 Mar 2024 18:50:23 +0000 Subject: [PATCH 06/10] fixed part of review comments --- lib/default.nix | 2 ++ nixosModules/hermes/default.nix | 2 +- nixosTests/tests/hermes-test.nix | 5 ++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index fe2b1b9a..e33ff958 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -168,6 +168,8 @@ in { gomod2nix --outdir "$CURDIR" ''; }; + # `hermesModuleConfigToml { modules }).config.hermes.toml` + # will be a string to put into [config.toml](https://hermes.informal.systems/documentation/configuration/configure-hermes.html) hermesModuleConfigToml = {modules}: pkgs.lib.evalModules { modules = diff --git a/nixosModules/hermes/default.nix b/nixosModules/hermes/default.nix index a84c5451..7b570aa6 100644 --- a/nixosModules/hermes/default.nix +++ b/nixosModules/hermes/default.nix @@ -1,5 +1,5 @@ { - nix-std ? import (fetchTarball "https://github.com/chessai/nix-std/archive/master.tar.gz"), + nix-std, hermes, }: { lib, diff --git a/nixosTests/tests/hermes-test.nix b/nixosTests/tests/hermes-test.nix index d8e123b3..eada0107 100644 --- a/nixosTests/tests/hermes-test.nix +++ b/nixosTests/tests/hermes-test.nix @@ -1,8 +1,7 @@ { pkgs, - nix-std, - hermes, gaia, + hermes, }: let jsonRpcCurlRequest = addr: port: ''${pkgs.curl}/bin/curl -X POST -H 'Content-Type: application/json' -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"health\",\"params\":[]}' http://${addr}:${builtins.toString port} 2>&1''; sharedModule = { @@ -127,7 +126,7 @@ in services.hermes = { enable = true; global.log_level = "trace"; - # package = hermes; + package = hermes; rest = { port = defaultRestPort; host = "0.0.0.0"; From 0c08e2f8a8f0453401bb4c2028535bb04d8223d6 Mon Sep 17 00:00:00 2001 From: dzmitry-lahoda Date: Mon, 18 Mar 2024 18:56:40 +0000 Subject: [PATCH 07/10] fixed non toml part --- nixosModules/hermes/chain-options.nix | 1 + nixosModules/hermes/default.nix | 11 +++++++++-- nixosModules/hermes/options.nix | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/nixosModules/hermes/chain-options.nix b/nixosModules/hermes/chain-options.nix index 7cb15f09..10938feb 100644 --- a/nixosModules/hermes/chain-options.nix +++ b/nixosModules/hermes/chain-options.nix @@ -1,3 +1,4 @@ +# will be used to generate `[[chains]]` part of [config.toml](https://hermes.informal.systems/documentation/configuration/description.html) {lib}: with lib; { # Required diff --git a/nixosModules/hermes/default.nix b/nixosModules/hermes/default.nix index 7b570aa6..5a1751f7 100644 --- a/nixosModules/hermes/default.nix +++ b/nixosModules/hermes/default.nix @@ -9,9 +9,16 @@ }: let hermes-path = lib.meta.getExe hermes; prev = config.services.hermes; - cfg = prev // {chains = builtins.map (pkgs.lib.filterAttrsRecursive (_: v: v != null)) prev.chains;}; + sanitizedCfg = + # remove non toml parts + (builtins.map (pkgs.lib.filterAttrs (k: _: k == "package")) prev) + // { + chains = + # remove `null` from toml render + builtins.map (pkgs.lib.filterAttrsRecursive (_: v: v != null)) prev.chains; + }; hermes-toml = pkgs.writeTextFile { - text = nix-std.lib.serde.toTOML cfg; + text = nix-std.lib.serde.toTOML sanitizedCfg; name = "config.toml"; }; in diff --git a/nixosModules/hermes/options.nix b/nixosModules/hermes/options.nix index 0f7e2fe6..4a2ee57b 100644 --- a/nixosModules/hermes/options.nix +++ b/nixosModules/hermes/options.nix @@ -1,3 +1,4 @@ +# will be used to render [config.toml](https://hermes.informal.systems/documentation/configuration/description.html) {lib}: with lib; { global = mkOption { From 81531ec8313b6d6c404fdcc2fb66c684bc9c3e02 Mon Sep 17 00:00:00 2001 From: dzmitry-lahoda Date: Mon, 18 Mar 2024 19:09:14 +0000 Subject: [PATCH 08/10] fixed test build --- lib/default.nix | 1 + nixosModules/hermes/default.nix | 15 +++++++++------ nixosTests/tests/hermes-test.nix | 1 + 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index e33ff958..f58de51d 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -181,6 +181,7 @@ in { ... }: let prev = config.hermes; + # remove `null` from toml render cfg = prev // {chains = builtins.map (pkgs.lib.filterAttrsRecursive (_: v: v != null)) prev.chains;}; hermes-toml = nix-std.lib.serde.toTOML (builtins.removeAttrs cfg ["toml"]); in diff --git a/nixosModules/hermes/default.nix b/nixosModules/hermes/default.nix index 5a1751f7..c038c507 100644 --- a/nixosModules/hermes/default.nix +++ b/nixosModules/hermes/default.nix @@ -7,11 +7,14 @@ pkgs, ... }: let - hermes-path = lib.meta.getExe hermes; + defaultPackage = + if hermes != null + then hermes + else pkgs.hermes; prev = config.services.hermes; sanitizedCfg = # remove non toml parts - (builtins.map (pkgs.lib.filterAttrs (k: _: k == "package")) prev) + (builtins.removeAttrs prev ["package"]) // { chains = # remove `null` from toml render @@ -28,15 +31,15 @@ in // { enable = mkEnableOption "hermes"; package = mkOption { - type = types.str; - default = hermes-path; + type = types.package; + default = defaultPackage; description = '' The hermes (ibc-rs) software to run. ''; }; }; - config = mkIf cfg.enable { + config = mkIf sanitizedCfg.enable { systemd.services.hermes = { description = "Hermes Daemon"; wantedBy = ["multi-user.target"]; @@ -44,7 +47,7 @@ in preStart = "echo \"hermes toml can be found here: ${hermes-toml}\""; serviceConfig = { Type = "notify"; - ExecStart = "${cfg.package} -c ${hermes-toml} start"; + ExecStart = "${pkgs.lib.meta.getExe config.services.hermes.package} -c ${hermes-toml} start"; }; }; }; diff --git a/nixosTests/tests/hermes-test.nix b/nixosTests/tests/hermes-test.nix index eada0107..b1a15b9d 100644 --- a/nixosTests/tests/hermes-test.nix +++ b/nixosTests/tests/hermes-test.nix @@ -1,5 +1,6 @@ { pkgs, + nix-std, gaia, hermes, }: let From 6395a43e2e24136828567f741b4448a9cf3285cd Mon Sep 17 00:00:00 2001 From: dzmitry-lahoda Date: Mon, 18 Mar 2024 22:21:39 +0000 Subject: [PATCH 09/10] fixed config comment --- lib/default.nix | 21 ++--- nixosModules/hermes/base.nix | 18 ++++ .../{options.nix => config-options.nix} | 0 nixosModules/hermes/default.nix | 24 ++---- nixosTests/tests/hermes-test.nix | 86 ++++++++++--------- 5 files changed, 79 insertions(+), 70 deletions(-) create mode 100644 nixosModules/hermes/base.nix rename nixosModules/hermes/{options.nix => config-options.nix} (100%) diff --git a/lib/default.nix b/lib/default.nix index f58de51d..65915691 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -180,19 +180,14 @@ in { config, ... }: let - prev = config.hermes; - # remove `null` from toml render - cfg = prev // {chains = builtins.map (pkgs.lib.filterAttrsRecursive (_: v: v != null)) prev.chains;}; - hermes-toml = nix-std.lib.serde.toTOML (builtins.removeAttrs cfg ["toml"]); - in - with lib; { - options.hermes = - (import ../nixosModules/hermes/options.nix {inherit lib;}) - // { - toml = mkOption {type = types.unique {message = "only one toml output";} types.str;}; - }; - config.hermes.toml = hermes-toml; - } + # pleae not that it is not `nixos service`(systemd/launchd), + # but just abstract module to be serviced on top by anything (container/vm/process manager/futher generator) + cfg = config.hermes; + base = import ../nixosModules/hermes/base.nix {inherit lib nix-std cfg;}; + in { + options.hermes = base.options; + config.hermes.toml = base.config.toml; + } ) ] ++ modules; diff --git a/nixosModules/hermes/base.nix b/nixosModules/hermes/base.nix new file mode 100644 index 00000000..7fe39e0e --- /dev/null +++ b/nixosModules/hermes/base.nix @@ -0,0 +1,18 @@ +{ + lib, + nix-std, + cfg, +}: +with lib; { + options = { + config = import ./config-options.nix {inherit lib;}; + toml = mkOption {type = types.unique {message = "only one toml output";} types.str;}; + }; + config = { + toml = let + # remove `null` from toml render + sanitizedCfg = filterAttrsRecursive (_: v: v != null) cfg.config; + in + nix-std.lib.serde.toTOML sanitizedCfg; + }; +} diff --git a/nixosModules/hermes/options.nix b/nixosModules/hermes/config-options.nix similarity index 100% rename from nixosModules/hermes/options.nix rename to nixosModules/hermes/config-options.nix diff --git a/nixosModules/hermes/default.nix b/nixosModules/hermes/default.nix index c038c507..ed47374e 100644 --- a/nixosModules/hermes/default.nix +++ b/nixosModules/hermes/default.nix @@ -11,23 +11,16 @@ if hermes != null then hermes else pkgs.hermes; - prev = config.services.hermes; - sanitizedCfg = - # remove non toml parts - (builtins.removeAttrs prev ["package"]) - // { - chains = - # remove `null` from toml render - builtins.map (pkgs.lib.filterAttrsRecursive (_: v: v != null)) prev.chains; - }; - hermes-toml = pkgs.writeTextFile { - text = nix-std.lib.serde.toTOML sanitizedCfg; + cfg = config.services.hermes; + base = import ./base.nix {inherit lib nix-std cfg;}; + tomlFile = pkgs.writeTextFile { name = "config.toml"; + text = base.config.toml; }; in with lib; { options.services.hermes = - import ./options.nix {inherit lib;} + base.options // { enable = mkEnableOption "hermes"; package = mkOption { @@ -39,15 +32,16 @@ in }; }; - config = mkIf sanitizedCfg.enable { + config = mkIf cfg.enable { + services.hermes.toml = base.config.toml; systemd.services.hermes = { description = "Hermes Daemon"; wantedBy = ["multi-user.target"]; after = ["network.target"]; - preStart = "echo \"hermes toml can be found here: ${hermes-toml}\""; + preStart = "echo \"hermes toml can be found here: ${tomlFile}\""; serviceConfig = { Type = "notify"; - ExecStart = "${pkgs.lib.meta.getExe config.services.hermes.package} -c ${hermes-toml} start"; + ExecStart = "${pkgs.lib.meta.getExe cfg.package} -c ${tomlFile} start"; }; }; }; diff --git a/nixosTests/tests/hermes-test.nix b/nixosTests/tests/hermes-test.nix index b1a15b9d..2c73ca1e 100644 --- a/nixosTests/tests/hermes-test.nix +++ b/nixosTests/tests/hermes-test.nix @@ -126,50 +126,52 @@ in services.hermes = { enable = true; - global.log_level = "trace"; package = hermes; - rest = { - port = defaultRestPort; - host = "0.0.0.0"; - }; - telemetry = { - port = defaultMetricsPort; - host = "0.0.0.0"; + config = { + global.log_level = "trace"; + rest = { + port = defaultRestPort; + host = "0.0.0.0"; + }; + telemetry = { + port = defaultMetricsPort; + host = "0.0.0.0"; + }; + chains = [ + { + id = "nixos"; + rpc_addr = "http://validator1:26657"; + grpc_addr = "http://validator1:9090"; + account_prefix = "cosmos"; + address_type = {derivation = "cosmos";}; + key_name = "testkey"; + gas_price = { + price = 0.001; + denom = "stake"; + }; + event_source = { + mode = "pull"; + interval = "1s"; + }; + } + { + id = "nixos2"; + rpc_addr = "http://validator2:26657"; + grpc_addr = "http://validator2:9090"; + account_prefix = "cosmos"; + address_type = {derivation = "cosmos";}; + key_name = "testkey"; + gas_price = { + price = 0.001; + denom = "stake"; + }; + event_source = { + mode = "pull"; + interval = "1s"; + }; + } + ]; }; - chains = [ - { - id = "nixos"; - rpc_addr = "http://validator1:26657"; - grpc_addr = "http://validator1:9090"; - account_prefix = "cosmos"; - address_type = {derivation = "cosmos";}; - key_name = "testkey"; - gas_price = { - price = 0.001; - denom = "stake"; - }; - event_source = { - mode = "pull"; - interval = "1s"; - }; - } - { - id = "nixos2"; - rpc_addr = "http://validator2:26657"; - grpc_addr = "http://validator2:9090"; - account_prefix = "cosmos"; - address_type = {derivation = "cosmos";}; - key_name = "testkey"; - gas_price = { - price = 0.001; - denom = "stake"; - }; - event_source = { - mode = "pull"; - interval = "1s"; - }; - } - ]; }; }; }; From ec7e43bc70b32b6168460f80cc63a89f3fac054b Mon Sep 17 00:00:00 2001 From: dzmitry-lahoda Date: Tue, 19 Mar 2024 15:53:23 +0000 Subject: [PATCH 10/10] updated doc comments Co-authored-by: Jonathan Lorimer <32466011+JonathanLorimer@users.noreply.github.com> --- lib/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 65915691..27f53502 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -180,8 +180,9 @@ in { config, ... }: let - # pleae not that it is not `nixos service`(systemd/launchd), - # but just abstract module to be serviced on top by anything (container/vm/process manager/futher generator) + # please note that this is not `nixos service`(systemd/launchd), + # but just the "abstract" module that can be used to build other configurations: + # static config files, containers, vm, process manager, futher generator. cfg = config.hermes; base = import ../nixosModules/hermes/base.nix {inherit lib nix-std cfg;}; in {