From 27635fbe9265eb7cae65141c8a53f31558c00409 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Thu, 6 Feb 2025 01:36:23 +0100 Subject: [PATCH] modules/usteer: init This adds the usteer daemon service for Liminix. Signed-off-by: Raito Bezarius --- modules/usteer/default.nix | 26 ++++++++++++++++++++++++++ modules/usteer/usteer.nix | 18 ++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 modules/usteer/default.nix create mode 100644 modules/usteer/usteer.nix diff --git a/modules/usteer/default.nix b/modules/usteer/default.nix new file mode 100644 index 0000000..f94be4c --- /dev/null +++ b/modules/usteer/default.nix @@ -0,0 +1,26 @@ +## usteer +## ============== +## +## usteer is a band-steering daemon for hostapd. +## this helps you optimize the roaming behavior of wireless clients (STAs) in an ESS +## consisting of multiple BSS / APs. +## you want this as soon as you are deploying Liminix on >1 APs that are close to each other. +{ lib, pkgs, ... }: +let + inherit (lib) mkOption types; + inherit (pkgs) liminix; +in { + options.system.service.usteer = mkOption { + type = liminix.lib.types.serviceDefn; + }; + + config = { + system.service.usteer = pkgs.liminix.callService ./usteer.nix { + ifname = mkOption { + type = types.str; + description = "interface name on which to connect to other usteer instances"; + }; + }; + }; +} + diff --git a/modules/usteer/usteer.nix b/modules/usteer/usteer.nix new file mode 100644 index 0000000..0750a15 --- /dev/null +++ b/modules/usteer/usteer.nix @@ -0,0 +1,18 @@ +{ + liminix +, lib +, usteer +}: +{ ifname }: +let + inherit (liminix.services) longrun; + name = "usteerd"; +in +longrun { + # Does it need to be unique? + inherit name; + run = '' + mkdir -p /run/usteerd + ${usteer}/bin/usteerd -s -v -i ${ifname} + ''; +}