Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i2pd module options map to outdated configuration, has no extraConfig or configFile option #228182

Open
tim-tx opened this issue Apr 25, 2023 · 3 comments · May be fixed by #225601
Open

i2pd module options map to outdated configuration, has no extraConfig or configFile option #228182

tim-tx opened this issue Apr 25, 2023 · 3 comments · May be fixed by #225601
Labels
0.kind: bug Something is broken

Comments

@tim-tx
Copy link
Contributor

tim-tx commented Apr 25, 2023

Describe the bug

The options in the i2pd module map to an outdated version of the supported upstream config. For example ssu2 section is missing from the NixOS module, and ntcp-related options are removed upstream but still present in the NixOS module options. The NixOS module also does not provide any extraConfig or configFile option for manually writing the module config in part or in whole as a workaround.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Enable and attempt to configure services.i2pd with options from upstream documented configuration options or upstream sample configuration, for example anything in ssu2 section

Expected behavior

Be able to map from NixOS module config options to supported upstream config options, either NixOS specific module options or generic extraConfig or configFile options.

Additional context

NixOS module also contains options relating to ntcp, removed upstream. Other inconsistencies between NixOS module and upstream config may exist, I have not done an exhaustive comparison.

Notify maintainers

@edwtjo

@tim-tx tim-tx added the 0.kind: bug Something is broken label Apr 25, 2023
@tim-tx
Copy link
Contributor Author

tim-tx commented Apr 25, 2023

As a workaround you could write your own config with pkgs.writeText and set systemd.services.i2pd.serviceConfig.ExecStart to include that config.

Also, the NixOS i2pd module does a manual mapping to an INI file with a few sectionless ("global") parameters. The module could more efficiently use freeform settings and pkgs.formats.ini, except pkgs.formats.ini does not currently support writing an INI file with sectionless "global" parameters. PR #228051 adds global parameter support to pkgs.formats.ini which I have used locally to convert the module to freeform type options.

@one-d-wide
Copy link
Contributor

one-d-wide commented Jul 23, 2023

I have already refactored this module here with addition of some new features (optional enumerators for indexed parameters like bandwidth, config validation by actual i2pd executable, runtime secrets passing, etc.). But @edwtjo seems to be busy ever since.

You can help advance this PR by testing it and leaving your review:

$ cat configuration.nix
{ inputs, pkgs, ... }:

let
  # With flakes
  i2pd_override = inputs.i2pd_override;
  # Without flakes
  i2pd_override = pkgs.fetchFromGitHub {
    owner = "one-d-wide";
    repo = "nixpkgs";
    rev = "363360f33bbd379dda3a38eda0ede0d3330667e4";
    sha256 = "sha256-0fv/oHtM7at5/bUgiVlog+CYBPAm7xDGK/Hk0axY+gY=";
  };
in
{
  ...
  # Override `i2pd` module
  disabledModules = [ "services/networking/i2pd.nix" ];
  imports = [ "${i2pd_override}/nixos/modules/services/networking/i2pd.nix" ];
  ...
}

$ cat flake.nix
inputs = {
  ...
  i2pd_override = {
    url = "github:one-d-wide/nixpkgs/i2pd-refactor-freeform";
    flake = false;
  };
  ...
}

Then rebuild your system and type man configuration.nix to list availible options.

I added support for free-formed configuration (RFC42), so all official options are now directly accessible with automatic validation!

@doronbehar doronbehar linked a pull request Sep 10, 2023 that will close this issue
12 tasks
@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/i2pd-config-produces-errors-is-it-my-fault/38818/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants