"claude. release the files."

This commit is contained in:
2026-07-12 16:05:12 +01:00
parent d42ad4b44f
commit 9c38e07741
7 changed files with 335 additions and 243 deletions
+18 -7
View File
@@ -57,6 +57,10 @@
"gamemode"
];
};
# Register GSettings schemas so GTK/GLib apps (orca-slicer) can find
# them; without this GLib aborts with "No GSettings schemas are
# installed on the system" on non-GNOME desktops.
programs.dconf.enable = true;
virtualisation.libvirtd.enable = false;
# virtualisation.waydroid.enable = true;
# # Newer kernel versions may need
@@ -100,17 +104,24 @@
blender
bottles
pi-coding-agent
# orca-slicer's wrapGAppsHook does not actually wrap the installed
# binary, so neither the GSettings schema path nor the NVIDIA/zink
# workaround env from `withNvidiaGLWorkaround` reach the process.
# Wrap it ourselves: prepend the gtk3 + gsettings-desktop schema dirs
# to XDG_DATA_DIRS (fixes "No GSettings schemas are installed on the
# system") and set the zink GL workaround explicitly.
(pkgs.symlinkJoin {
name = "orca-slicer";
paths = [ pkgs.orca-slicer ];
buildInputs = [ pkgs.makeWrapper ];
paths = [ (pkgs.orca-slicer.override { withNvidiaGLWorkaround = true; }) ];
nativeBuildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/orca-slicer \
--prefix LC_ALL : C \
--prefix MESA_LOADER_DRIVER_OVERRIDE : zink \
--prefix WEBKIT_DISABLE_DMABUF_RENDERER : 1 \
--prefix __EGL_VENDOR_LIBRARY_FILENAMES : ${pkgs.mesa}/share/glvnd/egl_vendor.d/50_mesa.json \
--prefix GALLIUM_DRIVER : zink
--prefix XDG_DATA_DIRS : "${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}:${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}" \
--set __GLX_VENDOR_LIBRARY_NAME mesa \
--set __EGL_VENDOR_LIBRARY_FILENAMES /run/opengl-driver/share/glvnd/egl_vendor.d/50_mesa.json \
--set MESA_LOADER_DRIVER_OVERRIDE zink \
--set GALLIUM_DRIVER zink \
--set WEBKIT_DISABLE_DMABUF_RENDERER 1
'';
})
];
+10 -1
View File
@@ -47,6 +47,15 @@
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
libva-minimal
vulkan-loader
];
};
environment.sessionVariables = {
LIBVA_DRIVER_NAME = "nvidia";
NVD_BACKEND = "direct";
};
services.xserver.videoDrivers = [ "nvidia" ];
@@ -86,7 +95,7 @@
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
open = false;
open = true;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
+57 -31
View File
@@ -3,7 +3,8 @@
__findFile,
modules,
...
}: {
}:
{
den.aspects.rpi5 = {
includes = [
<modules/raspberry-pi/5>
@@ -14,41 +15,66 @@
<modules/services/ddns>
<modules/services/rtmp-to-whip>
];
nixos = {
networking.hostName = "nixos-001-rp5";
nixos =
{ pkgs, ... }:
{
networking.hostName = "nixos-001-rp5";
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
fsType = "ext4";
options = ["noatime"];
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
fsType = "ext4";
options = [ "noatime" ];
};
"/boot/firmware" = {
device = "/dev/disk/by-uuid/2175-794E";
fsType = "vfat";
options = [ "noatime" ];
};
};
"/boot/firmware" = {
device = "/dev/disk/by-uuid/2175-794E";
fsType = "vfat";
options = ["noatime"];
networking.firewall = {
enable = true;
allowedTCPPorts = [
80
443
8080
];
allowedUDPPortRanges = [ ];
};
system.activationScripts.docker-config-fix = ''
if [ -d /root/.docker/config.json ]; then
rm -rf /root/.docker/config.json
echo '{}' > /root/.docker/config.json
fi
'';
virtualisation.docker.enable = true;
virtualisation.docker.package = pkgs.docker;
virtualisation.docker.autoPrune = {
enable = true;
dates = "weekly";
flags = [
"--all"
"--volumes"
];
};
virtualisation.oci-containers.backend = "docker";
services.openssh.enable = true;
nixpkgs.hostPlatform = "aarch64-linux";
nix.gc = {
automatic = true;
};
};
networking.firewall = {
enable = true;
allowedTCPPorts = [
80
443
8080
homeManager =
{ pkgs, ... }:
{
home.packages = [
pkgs.btop
];
allowedUDPPortRanges = [];
};
virtualisation.docker.enable = true;
virtualisation.oci-containers.backend = "docker";
services.openssh.enable = true;
nixpkgs.hostPlatform = "aarch64-linux";
nix.gc = {
automatic = true;
};
};
};
}
+32 -3
View File
@@ -16,10 +16,39 @@
modules.helium = settings: {
homeManager =
{ pkgs, ... }:
let
heliumPkg = inputs.heliumFlake.packages.${pkgs.stdenv.hostPlatform.system}.helium;
# The upstream `helium` launcher is a plain Nix wrapper that ignores any
# *-flags.conf file (that convention is Arch-specific, not NixOS). So to
# actually pass command-line flags we re-wrap the launcher here.
#
# Flag names verified against this Helium build's binary strings.
# - AcceleratedVideoDecodeLinuxGL / ...ZeroCopyGL: the VA-API GL decode
# path (renamed from the old Vaapi* names, which are no-ops here).
# - VaapiOnNvidiaGPUs: required. Chromium disables VA-API on NVIDIA by
# default and hard-skips the nvidia-drm device ("Should skip nVidia
# device named: nvidia-drm" in the logs); this re-enables it, routing
# decode to NVDEC through the nvidia-vaapi-driver bridge.
# - VaapiIgnoreDriverChecks: bypass the driver allowlist.
# HEVC decode itself needs no runtime flag in this build (enable_platform_hevc
# is compiled in and on by default). Wayland-only: the NVIDIA VA-API path
# is broken under X11. Upstream considers nvidia-vaapi-driver unsupported,
# so confirm via chrome://media-internals (decoder should read VaapiVideoDecoder).
helium = pkgs.symlinkJoin {
name = "helium-wrapped";
paths = [ heliumPkg ];
nativeBuildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/helium \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ pkgs.vulkan-loader ]}" \
--add-flags "--enable-features=AcceleratedVideoDecodeLinuxGL,AcceleratedVideoDecodeLinuxZeroCopyGL,VaapiOnNvidiaGPUs,VaapiIgnoreDriverChecks" \
--add-flags "--ignore-gpu-blocklist" \
--add-flags "--disable-gpu-sandbox"
'';
};
in
{
home.packages = [
inputs.heliumFlake.packages.${pkgs.stdenv.hostPlatform.system}.helium
];
home.packages = [ helium ];
nixpkgs.config.allowUnfree = true;
# Gives me widevine support. yay
xdg.configFile."net.imput.helium/WidevineCdm/latest-component-updated-widevine-cdm" = {
+16 -10
View File
@@ -4,7 +4,8 @@
modules,
inputs,
...
}: {
}:
{
flake-file.inputs = {
raspberry-pi-nix.url = "github:cmyk/raspberry-pi-nix";
nixos-raspberrypi.url = "github:nvmd/nixos-raspberrypi/main";
@@ -13,17 +14,22 @@
modules.raspberry-pi = {
provides = {
"5" = {
nixos = {pkgs, ...}: {
imports = [
inputs.nixos-hardware.nixosModules.raspberry-pi-5
];
nixos =
{ pkgs, ... }:
{
imports = [
inputs.nixos-hardware.nixosModules.raspberry-pi-5
];
environment.systemPackages = with pkgs; [
libraspberrypi
];
boot.kernelPackages = pkgs.linuxPackages;
boot.kernel.sysctl."vm.mmap_rnd_bits" = pkgs.lib.mkForce 16;
boot.supportedFilesystems.zfs = false;
};
environment.systemPackages = with pkgs; [
libraspberrypi
];
boot.supportedFilesystems.zfs = false;
};
};
};
};
+90 -56
View File
@@ -3,69 +3,103 @@
__findFile,
modules,
...
}: {
}:
{
modules.services.provides.rtmp-to-whip = {
nixos = {
config,
pkgs,
...
}: {
systemd.services.init-rtmp-to-whip-network = {
description = "Create rtmp-to-whip docker network";
after = [ "docker.service" "docker.socket" ];
requires = [ "docker.service" "docker.socket" ];
before = [ "docker-rtmp-to-whip.service" "docker-rtmp-to-whip-frontend.service" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
script = ''
${pkgs.docker}/bin/docker network inspect rtmp-to-whip >/dev/null 2>&1 || \
${pkgs.docker}/bin/docker network create rtmp-to-whip
'';
};
virtualisation.oci-containers.containers = {
rtmp-to-whip = {
image = "reg.h.doloro.co.uk/doloro/rtmp-to-whip:latest";
ports = [
"0.0.0.0:1935:1935" # RTMP ingestion
"0.0.0.0:6969:6969/udp" # WebRTC UDP
nixos =
{
config,
pkgs,
...
}:
{
systemd.services.init-rtmp-to-whip-network = {
description = "Create rtmp-to-whip docker network";
after = [
"docker.service"
"docker.socket"
];
environment = {
PUBLIC_DOMAIN = "rtmp.h.doloro.co.uk";
RTC_PORT = "6969";
SIGNUP_CODE = "";
requires = [
"docker.service"
"docker.socket"
];
before = [
"docker-rtmp-to-whip.service"
"docker-rtmp-to-whip-frontend.service"
];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
volumes = [
"/data/rtmp-to-whip/db.sqlite:/app/db.sqlite"
];
extraOptions = [ "--network=rtmp-to-whip" ];
script = ''
${pkgs.docker}/bin/docker network inspect rtmp-to-whip >/dev/null 2>&1 || \
${pkgs.docker}/bin/docker network create rtmp-to-whip
'';
};
rtmp-to-whip-frontend = {
image = "reg.h.doloro.co.uk/doloro/rtmp-to-whip-frontend:latest";
ports = [
"0.0.0.0:3002:3000"
];
environment = {
VITE_API_URL = "http://rtmp-to-whip:3000";
virtualisation.oci-containers.containers = {
rtmp-to-whip = {
image = "reg.h.doloro.co.uk/doloro/rtmp-to-whip:latest-aarch64";
ports = [
"0.0.0.0:1935:1935"
"0.0.0.0:6969:6969/udp"
"127.0.0.1:3001:3000"
];
environment = {
PUBLIC_DOMAIN = "stream.h.doloro.co.uk";
RTC_PORT = "6969";
SIGNUP_CODE = "mreowmreow-pawsatyou";
RUST_LOG = "info,warn";
};
volumes = [
"/data/rtmp-to-whip/db:/db"
];
extraOptions = [ "--network=rtmp-to-whip" ];
};
extraOptions = [ "--network=rtmp-to-whip" ];
rtmp-to-whip-frontend = {
image = "reg.h.doloro.co.uk/doloro/rtmp-to-whip-frontend:latest-aarch64";
ports = [
"127.0.0.1:3002:3000"
];
environment = {
VITE_API_URL = "https://stream.h.doloro.co.uk/api";
};
extraOptions = [ "--network=rtmp-to-whip" ];
};
rtmp-to-whip-watchtower = {
image = "ghcr.io/nicholas-fedor/watchtower:latest";
volumes = [
"/var/run/docker.sock:/var/run/docker.sock"
];
environment = {
WATCHTOWER_CLEANUP = "true";
WATCHTOWER_POLL_INTERVAL = "300";
};
cmd = [
"rtmp-to-whip"
"rtmp-to-whip-frontend"
];
};
};
networking.firewall = {
allowedTCPPorts = [ 1935 ];
allowedUDPPorts = [ 6969 ];
};
services.caddy = pkgs.lib.mkIf config.services.caddy.enable {
virtualHosts."stream.h.doloro.co.uk".extraConfig = ''
handle /api* {
reverse_proxy :3001
}
handle {
reverse_proxy :3002
}
'';
};
};
networking.firewall = {
allowedTCPPorts = [ 1935 ];
allowedUDPPorts = [ 6969 ];
};
services.caddy = pkgs.lib.mkIf config.services.caddy.enable {
virtualHosts."stream.h.doloro.co.uk".extraConfig = ''
reverse_proxy :3002
'';
};
};
};
}