mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
feat(bbuddy): evdev barcode scanner client
This commit is contained in:
parent
c3cd9b0564
commit
90901a302c
24 changed files with 847 additions and 253 deletions
27
modules/system/exports/barcodebuddy.nix
Normal file
27
modules/system/exports/barcodebuddy.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue