Add alvr nixos module
This commit is contained in:
parent
de70c6a16b
commit
3213902bb6
2 changed files with 35 additions and 1 deletions
34
modules/nixos/alvr.nix
Normal file
34
modules/nixos/alvr.nix
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.programs.alvr;
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
programs.alvr = {
|
||||||
|
enable = mkEnableOption (lib.mdDoc "ALVR");
|
||||||
|
|
||||||
|
package = mkPackageOption pkgs "alvr" {};
|
||||||
|
|
||||||
|
openFirewall = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = lib.mdDoc ''
|
||||||
|
Open the default ports in the firewall for the ALVR server.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
environment.systemPackages = [cfg.package];
|
||||||
|
|
||||||
|
networking.firewall = mkIf cfg.openFirewall {
|
||||||
|
allowedTCPPorts = [9943 9944];
|
||||||
|
allowedUDPPorts = [9943 9944];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -2,5 +2,5 @@
|
||||||
# These should be stuff you would like to share with others, not your personal configurations.
|
# These should be stuff you would like to share with others, not your personal configurations.
|
||||||
{
|
{
|
||||||
# List your module files here
|
# List your module files here
|
||||||
# my-module = import ./my-module.nix;
|
alvr = import ./alvr.nix;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue