mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-10 04:49:19 -08:00
27 lines
705 B
Nix
27 lines
705 B
Nix
{
|
|
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";
|
|
};
|
|
};
|
|
}
|