From 9b70561e159862257cab6d4822da482486cb2c13 Mon Sep 17 00:00:00 2001 From: Robert James Hernandez Date: Tue, 15 Apr 2025 23:15:58 +0000 Subject: [PATCH] nixos/ax25/axlisten: init --- nixos/modules/module-list.nix | 1 + .../services/networking/ax25/axlisten.nix | 62 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 nixos/modules/services/networking/ax25/axlisten.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index d7dddff46352..1f1317ddcdfe 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -1055,6 +1055,7 @@ ./services/networking/atticd.nix ./services/networking/autossh.nix ./services/networking/avahi-daemon.nix + ./services/networking/ax25/axlisten.nix ./services/networking/ax25/axports.nix ./services/networking/babeld.nix ./services/networking/bee.nix diff --git a/nixos/modules/services/networking/ax25/axlisten.nix b/nixos/modules/services/networking/ax25/axlisten.nix new file mode 100644 index 000000000000..ad887885c142 --- /dev/null +++ b/nixos/modules/services/networking/ax25/axlisten.nix @@ -0,0 +1,62 @@ +{ + config, + lib, + pkgs, + ... +}: + +let + inherit (lib) + types + ; + + inherit (lib.modules) + mkIf + ; + + inherit (lib.options) + mkEnableOption + mkOption + literalExpression + ; + + cfg = config.services.ax25.axlisten; +in +{ + options = { + + services.ax25.axlisten = { + + enable = mkEnableOption "AX.25 axlisten daemon"; + + package = mkOption { + type = types.package; + default = pkgs.ax25-apps; + defaultText = literalExpression "pkgs.ax25-apps"; + description = "The ax25-apps package to use."; + }; + + config = mkOption { + type = types.str; + default = "-art"; + description = '' + Options that will be passed to the axlisten daemon. + ''; + }; + }; + }; + + config = mkIf cfg.enable { + + systemd.services.axlisten = { + description = "AX.25 traffic monitor"; + wantedBy = [ "multi-user.target" ]; + after = [ "ax25-axports.target" ]; + requires = [ "ax25-axports.target" ]; + serviceConfig = { + Type = "exec"; + ExecStart = "${cfg.package}/bin/axlisten ${cfg.config}"; + }; + }; + }; +}