mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
feat(adb): service module
This commit is contained in:
parent
95e827221f
commit
594605ea69
6 changed files with 196 additions and 0 deletions
26
modules/system/exports/adb.nix
Normal file
26
modules/system/exports/adb.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
lib,
|
||||
gensokyo-zone,
|
||||
...
|
||||
}: let
|
||||
inherit (gensokyo-zone.lib) mkAlmostOptionDefault;
|
||||
inherit (lib.modules) mkIf;
|
||||
in {
|
||||
config.exports.services.adb = {config, ...}: {
|
||||
displayName = mkAlmostOptionDefault "ADB";
|
||||
nixos = {
|
||||
serviceAttr = "adb";
|
||||
assertions = mkIf config.enable [
|
||||
(nixosConfig: {
|
||||
assertion = config.ports.default.port == nixosConfig.services.adb.port;
|
||||
message = "port mismatch";
|
||||
})
|
||||
];
|
||||
};
|
||||
defaults.port.listen = mkAlmostOptionDefault "localhost";
|
||||
ports.default = {
|
||||
port = mkAlmostOptionDefault 5037;
|
||||
transport = "tcp";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue