Unverified Commit 55c0a308 authored by Matthieu Coudron's avatar Matthieu Coudron Committed by GitHub
Browse files

mptcpd: init at 0.13 (#355928)

parents abab1383 39e22be2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1133,6 +1133,7 @@
  ./services/networking/lxd-image-server.nix
  ./services/networking/magic-wormhole-mailbox-server.nix
  ./services/networking/matterbridge.nix
  ./services/networking/mptcpd.nix
  ./services/networking/microsocks.nix
  ./services/networking/mihomo.nix
  ./services/networking/minidlna.nix
+36 −0
Original line number Diff line number Diff line
{
  config,
  lib,
  pkgs,
  ...
}:
let

  cfg = config.services.mptcpd;

in

{

  options = {

    services.mptcpd = {

      enable = lib.mkEnableOption "the Multipath TCP path management daemon";

      package = lib.mkPackageOption pkgs "mptcpd" { };

    };

  };

  config = lib.mkIf cfg.enable {

    environment.systemPackages = [ cfg.package ];

    systemd.packages = [ cfg.package ];

  };

  meta.maintainers = with lib.maintainers; [ nim65s ];
}
+79 −0
Original line number Diff line number Diff line
{
  autoreconfHook,
  autoconf-archive,
  doxygen,
  ell,
  fetchFromGitHub,
  fontconfig,
  graphviz,
  lib,
  pandoc,
  perl,
  pkg-config,
  stdenv,
  systemd,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "mptcpd";
  version = "0.13";

  src = fetchFromGitHub {
    owner = "multipath-tcp";
    repo = "mptcpd";
    rev = "v${finalAttrs.version}";
    hash = "sha256-gPXtYmCLJ8eL6VfCi3kpDA7lNn38WB6J4FXefdu2D7M=";
  };

  outputs = [
    "out"
    "doc"
  ];

  nativeBuildInputs = [
    autoreconfHook
    autoconf-archive
    doxygen
    graphviz
    pandoc
    perl
    pkg-config
  ];

  # ref. https://github.com/multipath-tcp/mptcpd/blob/main/README.md#bootstrapping
  preConfigure = "./bootstrap";

  # fix: 'To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"'
  postConfigure = "doxygen -u";

  configureFlags = [
    "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
  ];

  # fix: 'Fontconfig error: Cannot load default config file: No such file: (null)'
  env.FONTCONFIG_FILE = "${fontconfig.out}/etc/fonts/fonts.conf";

  buildInputs = [
    ell
    systemd
  ];

  # fix: 'Fontconfig error: No writable cache directories'
  preBuild = "export XDG_CACHE_HOME=$(mktemp -d)";

  # build and install doc
  postBuild = "make doxygen-doc";
  postInstall = "mv doc $doc";

  doCheck = true;

  meta = {
    description = "Daemon for Linux that performs Multipath TCP path management related operations in the user space";
    homepage = "https://github.com/multipath-tcp/mptcpd";
    changelog = "https://github.com/multipath-tcp/mptcpd/blob/${finalAttrs.src.rev}/NEWS";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ nim65s ];
    mainProgram = "mptcpize";
    platforms = lib.platforms.linux;
  };
})