From a2ddc20e100561d9831a01466f62b468243df6a1 Mon Sep 17 00:00:00 2001 From: PassiveLemon Date: Sat, 27 Jan 2024 11:51:03 -0500 Subject: [PATCH 1/2] alvr: init at 20.6.1 --- pkgs/by-name/al/alvr/package.nix | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 pkgs/by-name/al/alvr/package.nix diff --git a/pkgs/by-name/al/alvr/package.nix b/pkgs/by-name/al/alvr/package.nix new file mode 100644 index 000000000000..803f352ae4e6 --- /dev/null +++ b/pkgs/by-name/al/alvr/package.nix @@ -0,0 +1,36 @@ +{ lib, + appimageTools, + fetchurl, +}: +let + pname = "alvr"; + version = "20.6.1"; + src = fetchurl { + url = "https://github.com/alvr-org/ALVR/releases/download/v${version}/ALVR-x86_64.AppImage"; + hash = "sha256-IYw3D18xUGWiFu74c4d8d4tohZztAD6mmZCYsDNxR+A="; + }; + + appimageContents = appimageTools.extractType2 { inherit pname version src; }; +in +appimageTools.wrapType2 { + inherit pname version src; + + extraInstallCommands = '' + mv $out/bin/alvr-${version} $out/bin/alvr + + install -Dm444 ${appimageContents}/alvr.desktop -t $out/share/applications + substituteInPlace $out/share/applications/alvr.desktop \ + --replace 'Exec=alvr_dashboard' 'Exec=alvr' + cp -r ${appimageContents}/usr/share/icons $out/share + ''; + + meta = with lib; { + description = "Stream VR games from your PC to your headset via Wi-Fi"; + homepage = "https://github.com/alvr-org/ALVR/"; + changelog = "https://github.com/alvr-org/ALVR/releases/tag/v${version}"; + license = licenses.mit; + mainProgram = "alvr"; + maintainers = with maintainers; [ passivelemon ]; + platforms = [ "x86_64-linux" ]; + }; +} From 1d3e2a92bc516a1ead80dafbd48a07fb935f684d Mon Sep 17 00:00:00 2001 From: PassiveLemon Date: Sat, 27 Jan 2024 12:06:23 -0500 Subject: [PATCH 2/2] nixos/alvr: init module --- .../manual/release-notes/rl-2405.section.md | 2 ++ nixos/modules/module-list.nix | 1 + nixos/modules/programs/alvr.nix | 35 +++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 nixos/modules/programs/alvr.nix diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md index e2c8b3abab41..8b5d020d0af3 100644 --- a/nixos/doc/manual/release-notes/rl-2405.section.md +++ b/nixos/doc/manual/release-notes/rl-2405.section.md @@ -65,6 +65,8 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m - [TuxClocker](https://github.com/Lurkki14/tuxclocker), a hardware control and monitoring program. Available as [programs.tuxclocker](#opt-programs.tuxclocker.enable). +- [ALVR](https://github.com/alvr-org/alvr), a VR desktop streamer. Available as [programs.alvr](#opt-programs.alvr.enable) + - [RustDesk](https://rustdesk.com), a full-featured open source remote control alternative for self-hosting and security with minimal configuration. Alternative to TeamViewer. ## Backward Incompatibilities {#sec-release-24.05-incompatibilities} diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index c2bcb2f78080..0839422ac2e9 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -139,6 +139,7 @@ ./programs/_1password-gui.nix ./programs/_1password.nix ./programs/adb.nix + ./programs/alvr.nix ./programs/appgate-sdp.nix ./programs/atop.nix ./programs/ausweisapp.nix diff --git a/nixos/modules/programs/alvr.nix b/nixos/modules/programs/alvr.nix new file mode 100644 index 000000000000..c01b74ad3a51 --- /dev/null +++ b/nixos/modules/programs/alvr.nix @@ -0,0 +1,35 @@ +{ config, pkgs, lib, ... }: + +with lib; + +let + cfg = config.programs.alvr; +in +{ + options = { + programs.alvr = { + enable = mkEnableOption (lib.mdDoc "ALVR, the VR desktop streamer"); + + package = mkPackageOption pkgs "alvr" { }; + + openFirewall = mkOption { + type = types.bool; + default = false; + description = lib.mdDoc '' + Whether to 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 ]; + }; + }; + + meta.maintainers = with maintainers; [ passivelemon ]; +}