Merge pull request #284154 from PassiveLemon/ALVR

alvr: init at 20.6.1
This commit is contained in:
h7x4 2024-02-02 11:36:08 +01:00 committed by GitHub
commit 7ac5d2ce0c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 74 additions and 0 deletions

View file

@ -71,6 +71,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.
- [systemd-lock-handler](https://git.sr.ht/~whynothugo/systemd-lock-handler/), a bridge between logind D-Bus events and systemd targets. Available as [services.systemd-lock-handler.enable](#opt-services.systemd-lock-handler.enable).

View file

@ -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

View file

@ -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 ];
}

View file

@ -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" ];
};
}