diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 4d227916c499..c0e466e3e220 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -181,6 +181,7 @@ ./programs/dublin-traceroute.nix ./programs/ecryptfs.nix ./programs/environment.nix + ./programs/envision.nix ./programs/evince.nix ./programs/extra-container.nix ./programs/fcast-receiver.nix diff --git a/nixos/modules/programs/envision.nix b/nixos/modules/programs/envision.nix new file mode 100644 index 000000000000..8849420a6b5f --- /dev/null +++ b/nixos/modules/programs/envision.nix @@ -0,0 +1,43 @@ +{ + 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; + }; + }; + + environment.systemPackages = [ cfg.package ]; + + networking.firewall = lib.mkIf cfg.openFirewall { + allowedTCPPorts = [ 9757 ]; + allowedUDPPorts = [ 9757 ]; + }; + }; + + meta.maintainers = pkgs.envision.meta.maintainers; +}