depot/third_party/nixpkgs/nixos/modules/programs/envision.nix
Default email f34ce41345 Project import generated by Copybara.
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
2024-07-27 08:49:29 +02:00

51 lines
915 B
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.envision;
in
{
options = {
programs.envision = {
enable = lib.mkEnableOption "envision";
package = lib.mkPackageOption pkgs "envision" {};
openFirewall = lib.mkEnableOption "the default ports in the firewall for the WiVRn server" // {
default = true;
};
};
};
config = lib.mkIf cfg.enable {
services.avahi = {
enable = true;
publish = {
enable = true;
userServices = true;
};
};
services.udev = {
enable = true;
packages = with pkgs; [
android-udev-rules
xr-hardware
];
};
environment.systemPackages = [ cfg.package ];
networking.firewall = lib.mkIf cfg.openFirewall {
allowedTCPPorts = [ 9757 ];
allowedUDPPorts = [ 9757 ];
};
};
meta.maintainers = pkgs.envision.meta.maintainers;
}