No description
Find a file
2025-08-27 22:49:17 +02:00
nixos Package iaxmodem 2025-08-27 22:49:17 +02:00
pkgs Package iaxmodem 2025-08-27 22:49:17 +02:00
.gitignore Init 2025-06-21 20:48:13 +02:00
flake.lock Update README 2025-08-10 17:22:13 +02:00
flake.nix Update README 2025-08-10 17:22:13 +02:00
README.md Package iaxmodem 2025-08-25 22:03:01 +02:00

t38modem

Just t38modem (https://github.com/hehol/t38modem) packaged for NixOS.

NixOS packages

  • t38modem: t38modem binary packaged with libpt and libopal
  • ptlib: libpt, required by t38modem
  • opal: libopal, required by t38modem
  • mgetty: mgetty+sendfax
  • iaxmodem: IAXmodem is a software modem written in C that uses an IAX channel
  • yajhfc: YajHFC (Yet another Java HylaFAX client) (https://www.yajhfc.de/)

NixOS modules

Example configuration (easyfax)

Minimal config with nixosModules.easyfax:

# configuration.nix
{
  inputs,
  pkgs,
  lib,
  config,
  ...
}:

{
  imports = [
    inputs.t38modem.nixosModules.t38modem
    inputs.t38modem.nixosModules.hylafax
    inputs.t38modem.nixosModules.easyfax
  ];

  # Firewall rules for HylaFax client access (e.g. https://www.yajhfc.de/)
  # Requires patched `hylafaxplus` (`pkgs/hylafaxplus/default.nix`) to not bind ephemeral ports with hfaxd's FTP passive mode
  # => `config.services.easyfax.hylafax.hfaxdDataTransferPortRange`
  networking.firewall = {
    enable = true;
    allowedTCPPorts = [
      config.services.easyfax.hylafax.hfaxdPort
    ];
    allowedTCPPortRanges = [
      {
        inherit (config.services.easyfax.hylafax.hfaxdDataTransferPortRange)
          from
          to
          ;
      }
    ];
  };

  environment.systemPackages = with pkgs; [
    minicom
    inetutils
    tcpdump
  ];

  services.easyfax = {
    enable = true;
    asterisk = {
      rtpPorts = {
        from = 10000;
        to = 20000;
      };
      sipPort = 5060;
      trunk = {
        server = "voip.example.com";
        serverPort = 5060;
        username = "1234";
        password = "foobar";
        callerId = "1234";
      };
    };
    t38modem = {
      ttyPrefix = "ttyFAX";
      modemCount = 5; # e.g. /dev/ttyFAX1, /dev/ttyFAX2, ...
      sipPort = 6060; # Must not collide with Asterisk!
    };
    hylafax = {
      enable = true;
      hfaxdDataTransferPortRange = {
        from = 43000;
        to = 45000;
      };
      hfaxdHosts = [
        # === *** Access from localhost *** ===
        { client = "127.0.0.1"; }
        { client = "localhost"; }
        # === *** Access from localhost *** ===

        # Custom users
        {
          client = ''user@192\.168\.1\.'';
          uid = 4000;
          passwd = "<HASHED USER PASSWORD (mkpasswd)>";
          adminwd = "<OPTIONAL HASHED ADMIN PASSWORD (mkpasswd)>";
        }
      ];
      tsi = "FaxMachine"; # Transmitter subscriber identification string
    };
  };

  system.stateVersion = "25.05";
}