DSLR-webcam, so old vr-desktop crap I was playing with but didn't remove
This commit is contained in:
parent
a3a16daf2a
commit
1f3653c6fb
@ -117,6 +117,7 @@
|
||||
./nixos/kde-desktop.nix
|
||||
./nixos/zerotier.nix
|
||||
./nixos/work.nix
|
||||
./nixos/vr-desktop.nix
|
||||
./nixos/cad.nix
|
||||
./nixos/gaming.nix
|
||||
];
|
||||
|
@ -3,7 +3,6 @@
|
||||
{
|
||||
imports = [
|
||||
./misc/dslr-webcam.nix
|
||||
./misc/wifi-multiplex.nix
|
||||
];
|
||||
# Enable the KDE Desktop Environment.
|
||||
services.xserver.enable = true;
|
||||
|
@ -1,3 +1,4 @@
|
||||
|
||||
{ pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
@ -6,17 +7,19 @@ let
|
||||
options v4l2loopback exclusive_caps=1 max_buffers=2 card_label="DSLR" video_nr=10
|
||||
'';
|
||||
|
||||
dslrUdevRule = ''ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="04a9", ATTR{idProduct}=="317b", RUN+="/bin/sh -c 'gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -f v4l2 /dev/video10'"'';
|
||||
dslrUdevRule = ''
|
||||
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="04a9", ENV{ID_USB_MODEL}=="Canon_Digital_Camera", RUN+="${pkgs.writeScriptBin "dslr-webcam" dslrWebcamScript}/bin/dslr-webcam"
|
||||
'';
|
||||
|
||||
dslrWebcamScript = ''
|
||||
#!/bin/sh
|
||||
modprobe dslr-webcam || true
|
||||
exec "${pkgs.gphoto2}/bin/gphoto2" --stdout --capture-movie | "${pkgs.ffmpeg}/bin/ffmpeg" -i - -vcodec rawvideo -pix_fmt yuv420p -f v4l2 /dev/video10
|
||||
'';
|
||||
in
|
||||
{
|
||||
# Ensure your system configuration includes these options:
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Ensure you have gphoto2 and ffmpeg available
|
||||
gphoto2
|
||||
ffmpeg
|
||||
];
|
||||
|
||||
boot.extraModulePackages = [ pkgs.linuxPackages.v4l2loopback ];
|
||||
|
||||
# Load v4l2loopback module with the required options
|
||||
@ -24,4 +27,9 @@ in
|
||||
|
||||
# Udev rule for DSLR camera
|
||||
services.udev.extraRules = dslrUdevRule;
|
||||
|
||||
# Install dslr-webcam script
|
||||
environment.systemPackages = with pkgs; [
|
||||
(writeScriptBin "dslr-webcam" dslrWebcamScript)
|
||||
];
|
||||
}
|
||||
|
@ -1,8 +1,10 @@
|
||||
|
||||
{ pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
wifiUdevRule = ''
|
||||
ACTION=="add", SUBSYSTEM=="net", ENV{DEVTYPE}=="wlan", !KERNEL=="phy*", RUN+="${pkgs.iw}/bin/iw dev %k info | grep -q '_ap' || ${pkgs.iw}/bin/iw dev %k interface add %k_ap type station"
|
||||
ACTION=="add", SUBSYSTEM=="net", ENV{DEVTYPE}=="wlan", ENV{ID_NET_NAME_MAC}=="", RUN+="/bin/sh -c '${pkgs.iw}/bin/iw dev %k interface add %k_ap type station'"
|
||||
|
||||
'';
|
||||
in
|
||||
{
|
||||
|
16
nixos/vr-desktop.nix
Normal file
16
nixos/vr-desktop.nix
Normal file
@ -0,0 +1,16 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
nixpkgs.overlays = [
|
||||
# (import (pkgs.fetchFromGitHub "https://github.com/SimulaVR/Simula.git"))
|
||||
];
|
||||
|
||||
services.monado.enable = true;
|
||||
|
||||
programs.alvr = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
];
|
||||
}
|
Loading…
Reference in New Issue
Block a user