No description
nixos | ||
pkgs | ||
.gitignore | ||
flake.lock | ||
flake.nix | ||
README.md |
t38modem
Just t38modem (https://github.com/hehol/t38modem) packaged for NixOS.
NixOS packages
t38modem
: t38modem binary packaged withlibpt
andlibopal
ptlib
:libpt
, required byt38modem
opal
:libopal
, required byt38modem
mgetty
: mgetty+sendfaxiaxmodem
: IAXmodem is a software modem written in C that uses an IAX channelyajhfc
: YajHFC (Yet another Java HylaFAX client) (https://www.yajhfc.de/)
NixOS modules
nixosModules.t38modem
: Systemd service for t38modemnixosModules.hylafax
: Patched HylaFax server (overrides https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/networking/hylafax/default.nix and patcheshylafaxplus
)nixosModules.easyfax
: Wrapper around Asterisk, t38modem and HylaFax for optimal experience (even behind NAT)
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";
}