feat(bbuddy): evdev barcode scanner client

This commit is contained in:
arcnmx 2024-05-17 13:29:59 -07:00
parent c3cd9b0564
commit 90901a302c
24 changed files with 847 additions and 253 deletions

View file

@ -0,0 +1,27 @@
{
lib,
gensokyo-zone,
...
}: let
inherit (gensokyo-zone.lib) mapAlmostOptionDefaults mkAlmostOptionDefault;
inherit (lib.modules) mkIf;
in {
config.exports.services.barcodebuddy = {config, ...}: {
nixos = {
serviceAttr = "barcodebuddy";
assertions = mkIf config.enable [
(nixosConfig: let
cfg = nixosConfig.services.barcodebuddy;
in {
assertion = config.ports.screen.port == cfg.screen.websocketPort;
message = "screen.websocketPort mismatch";
})
];
};
defaults.port.listen = mkAlmostOptionDefault "lan";
ports.screen = mapAlmostOptionDefaults {
port = 47631;
transport = "tcp";
};
};
}