Compare commits
1 Commits
main
...
ash/fix-re
| Author | SHA1 | Date | |
|---|---|---|---|
| d5432efa13 |
@@ -51,7 +51,6 @@ jobs:
|
||||
custom-beads
|
||||
custom-gastown
|
||||
custom-perles
|
||||
custom-nextcloud-talk-desktop
|
||||
qt-pinned-jellyfin-media-player
|
||||
qt-pinned-stremio
|
||||
nix-deck-kernel
|
||||
|
||||
@@ -185,7 +185,6 @@
|
||||
./machines/boxy/configuration.nix
|
||||
{
|
||||
home-manager.users.johno = import ./home/home-media-center.nix;
|
||||
# kodi user: AVR volume control + minimal Plasma config for Bigscreen session
|
||||
home-manager.users.kodi = import ./home/home-kodi.nix;
|
||||
home-manager.extraSpecialArgs = { inherit system; };
|
||||
}
|
||||
@@ -285,7 +284,6 @@
|
||||
"custom-mcrcon-rbw" = pkgs.custom.mcrcon-rbw;
|
||||
"custom-tea-rbw" = pkgs.custom.tea-rbw;
|
||||
"custom-rclone-torbox-setup" = pkgs.custom.rclone-torbox-setup;
|
||||
"custom-nextcloud-talk-desktop" = pkgs.custom.nextcloud-talk-desktop;
|
||||
"qt-pinned-jellyfin-media-player" = pkgsQt.jellyfin-media-player;
|
||||
"qt-pinned-stremio" = pkgsQt.stremio;
|
||||
# Flake input packages (beads, gastown) - these get version from input rev
|
||||
|
||||
@@ -20,7 +20,7 @@ in
|
||||
pkgs.element-desktop
|
||||
# Re-enabled in 25.11 after security issues were resolved
|
||||
pkgs.fluffychat
|
||||
pkgs.custom.nextcloud-talk-desktop
|
||||
pkgs.nextcloud-talk-desktop
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -22,11 +22,12 @@ with lib;
|
||||
sddm = true;
|
||||
wayland = true;
|
||||
};
|
||||
plasma-bigscreen = {
|
||||
kodi = {
|
||||
enable = true;
|
||||
autologin = true;
|
||||
jellyfinScaleFactor = 1.0;
|
||||
wayland = true;
|
||||
appLauncherServer.enable = true;
|
||||
jellyfinScaleFactor = 1.0;
|
||||
};
|
||||
nfs-mounts.enable = true;
|
||||
users.enable = true;
|
||||
@@ -71,3 +72,4 @@ with lib;
|
||||
system.stateVersion = "24.05"; # Did you read the comment?
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -6,5 +6,4 @@
|
||||
mcrcon-rbw = pkgs.callPackage ./mcrcon-rbw {};
|
||||
rclone-torbox-setup = pkgs.callPackage ./rclone-torbox-setup {};
|
||||
pi-coding-agent = pkgs.callPackage ./pi-coding-agent {};
|
||||
nextcloud-talk-desktop = pkgs.callPackage ./nextcloud-talk-desktop {};
|
||||
}
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
# Patched Nextcloud Talk Desktop with Wayland screen sharing support
|
||||
# Applies the core change from upstream draft PR #1022:
|
||||
# https://github.com/nextcloud/talk-desktop/pull/1022
|
||||
#
|
||||
# Patches the webpack bundle in app.asar to add setDisplayMediaRequestHandler
|
||||
# with useSystemPicker: true, enabling native PipeWire/portal-based
|
||||
# screen sharing on Wayland (Sway, Hyprland, etc.)
|
||||
{ lib
|
||||
, nextcloud-talk-desktop
|
||||
, nodejs
|
||||
, asar
|
||||
}:
|
||||
|
||||
nextcloud-talk-desktop.overrideAttrs (old: {
|
||||
pname = "nextcloud-talk-desktop-patched";
|
||||
|
||||
nativeBuildInputs = (old.nativeBuildInputs or []) ++ [ asar nodejs ];
|
||||
|
||||
# Patch the asar after the main installPhase creates the output
|
||||
postFixup = (old.postFixup or "") + ''
|
||||
echo "Patching app.asar for Wayland screen sharing..."
|
||||
ASAR_PATH="$out/opt/Nextcloud Talk-linux-x64/resources/app.asar"
|
||||
|
||||
WORK=$(mktemp -d)
|
||||
asar extract "$ASAR_PATH" "$WORK/app"
|
||||
|
||||
# In the webpack bundle:
|
||||
# session = l, desktopCapturer = a, app = n
|
||||
# We inject setDisplayMediaRequestHandler right after n.whenReady().then((async()=>{
|
||||
# useSystemPicker: true makes Electron use the native system picker
|
||||
# (PipeWire/xdg-desktop-portal on Wayland)
|
||||
node -e "
|
||||
const fs = require('fs');
|
||||
const p = '$WORK/app/.webpack/main/index.js';
|
||||
let c = fs.readFileSync(p, 'utf8');
|
||||
|
||||
if (c.includes('setDisplayMediaRequestHandler')) {
|
||||
console.log('Already patched');
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const marker = 'n.whenReady().then((async()=>{';
|
||||
const idx = c.indexOf(marker);
|
||||
if (idx === -1) {
|
||||
console.error('ERROR: Could not find whenReady marker in webpack bundle');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Inject after the marker
|
||||
const injection = 'l.defaultSession.setDisplayMediaRequestHandler(async(e,t)=>{const s=await a.getSources({types:[\"screen\",\"window\"]});s.length>0?t({video:s[0]}):t({})},{useSystemPicker:!0});';
|
||||
|
||||
c = c.slice(0, idx + marker.length) + injection + c.slice(idx + marker.length);
|
||||
fs.writeFileSync(p, c, 'utf8');
|
||||
console.log('Successfully patched main bundle for Wayland screen sharing');
|
||||
"
|
||||
|
||||
asar pack "$WORK/app" "$ASAR_PATH"
|
||||
rm -rf "$WORK"
|
||||
'';
|
||||
})
|
||||
@@ -12,7 +12,6 @@ with lib;
|
||||
./k3s-node
|
||||
./kodi
|
||||
./nfs-mounts
|
||||
./plasma-bigscreen
|
||||
./nvidia
|
||||
./printing
|
||||
./rclone-mount
|
||||
|
||||
@@ -17,10 +17,9 @@ in
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
programs.kdeconnect.enable = true;
|
||||
|
||||
# XDG Desktop Portal for default application handling
|
||||
# XDG Desktop Portal for default application handling in non-KDE environments
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
wlr.enable = cfg.wayland; # xdg-desktop-portal-wlr for Sway screen sharing
|
||||
extraPortals = with pkgs; [
|
||||
kdePackages.xdg-desktop-portal-kde # For KDE application integration
|
||||
xdg-desktop-portal-gtk # Fallback for GTK applications
|
||||
|
||||
@@ -1,134 +0,0 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.roles.plasma-bigscreen;
|
||||
|
||||
# Plasma Bigscreen package — not yet in nixpkgs, built from upstream master.
|
||||
# TODO: Replace with pkgs.kdePackages.plasma-bigscreen once available.
|
||||
plasma-bigscreen = pkgs.kdePackages.callPackage ./package.nix {};
|
||||
|
||||
jellyfinMediaPlayerPkg =
|
||||
if cfg.jellyfinScaleFactor != null
|
||||
then pkgs.symlinkJoin {
|
||||
name = "jellyfin-media-player-scaled";
|
||||
paths = [ pkgs.qt-pinned.jellyfin-media-player ];
|
||||
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||
postBuild = ''
|
||||
mkdir -p $out/bin
|
||||
rm -f $out/bin/jellyfin-desktop
|
||||
makeWrapper ${pkgs.qt-pinned.jellyfin-media-player}/bin/jellyfin-desktop $out/bin/jellyfin-desktop \
|
||||
--add-flags "--tv --scale-factor ${toString cfg.jellyfinScaleFactor}"
|
||||
|
||||
# Update .desktop file to include scale factor and TV mode arguments
|
||||
mkdir -p $out/share/applications
|
||||
rm -f $out/share/applications/org.jellyfin.JellyfinDesktop.desktop
|
||||
substitute ${pkgs.qt-pinned.jellyfin-media-player}/share/applications/org.jellyfin.JellyfinDesktop.desktop \
|
||||
$out/share/applications/org.jellyfin.JellyfinDesktop.desktop \
|
||||
--replace-fail "Exec=jellyfin-desktop" "Exec=jellyfin-desktop --tv --scale-factor ${toString cfg.jellyfinScaleFactor}"
|
||||
'';
|
||||
}
|
||||
else pkgs.qt-pinned.jellyfin-media-player;
|
||||
in
|
||||
{
|
||||
options.roles.plasma-bigscreen = {
|
||||
enable = mkEnableOption "Plasma Bigscreen TV interface";
|
||||
|
||||
autologin = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Auto-login to Plasma Bigscreen session";
|
||||
};
|
||||
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
default = "kodi";
|
||||
description = "User account for the Bigscreen session";
|
||||
};
|
||||
|
||||
jellyfinScaleFactor = mkOption {
|
||||
type = types.nullOr types.float;
|
||||
default = null;
|
||||
description = "Scale factor for Jellyfin Media Player UI (e.g., 1.0 for 100% scaling)";
|
||||
};
|
||||
|
||||
appLauncherServer = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Enable HTTP app launcher server for remote control";
|
||||
};
|
||||
port = mkOption {
|
||||
type = types.int;
|
||||
default = 8081;
|
||||
description = "Port for the app launcher HTTP server";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# Create the bigscreen user
|
||||
users.extraUsers.${cfg.user} = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" "networkmanager" "audio" "video" ];
|
||||
};
|
||||
|
||||
# Plasma Bigscreen is a Plasma 6 shell — needs Plasma 6 desktop manager
|
||||
services.desktopManager.plasma6.enable = true;
|
||||
|
||||
# Register the bigscreen session with the display manager
|
||||
services.displayManager = {
|
||||
sessionPackages = [ plasma-bigscreen ];
|
||||
} // optionalAttrs cfg.autologin {
|
||||
autoLogin.enable = true;
|
||||
autoLogin.user = cfg.user;
|
||||
defaultSession = "plasma-bigscreen-wayland";
|
||||
};
|
||||
xdg.portal.configPackages = [ plasma-bigscreen ];
|
||||
|
||||
# Fix homescreen not being focused after quitting app or on boot
|
||||
# xwaylandvideobridge can interfere with focus; exclude if present
|
||||
environment.plasma6.excludePackages =
|
||||
lib.optional (pkgs.kdePackages ? xwaylandvideobridge) pkgs.kdePackages.xwaylandvideobridge;
|
||||
|
||||
# Firewall for remote control
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = optional cfg.appLauncherServer.enable cfg.appLauncherServer.port;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
plasma-bigscreen
|
||||
firefox
|
||||
jellyfinMediaPlayerPkg
|
||||
qt-pinned.stremio
|
||||
wget
|
||||
] ++ optional cfg.appLauncherServer.enable pkgs.custom.app-launcher-server;
|
||||
|
||||
nixpkgs.config.permittedInsecurePackages = lib.warn
|
||||
"Allowing insecure package qtwebengine-5.15.19 as a jellyfin-media-player/stremio dependency."
|
||||
[
|
||||
"qtwebengine-5.15.19"
|
||||
];
|
||||
|
||||
programs.kdeconnect.enable = true;
|
||||
|
||||
systemd.user.services = mkIf cfg.appLauncherServer.enable {
|
||||
app-launcher-server = {
|
||||
description = "HTTP App Launcher Server";
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
after = [ "graphical-session.target" ];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.custom.app-launcher-server}/bin/app-launcher-server ${toString cfg.appLauncherServer.port}";
|
||||
Restart = "always";
|
||||
RestartSec = "5s";
|
||||
Environment = [
|
||||
"PATH=${pkgs.firefox}/bin:/run/current-system/sw/bin"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
@@ -1,131 +0,0 @@
|
||||
# Plasma Bigscreen — TV interface for Plasma 6
|
||||
# Not yet released or packaged in nixpkgs; built from upstream master.
|
||||
#
|
||||
# TODO: Remove this file once plasma-bigscreen lands in nixpkgs.
|
||||
# Tracking issue: https://github.com/NixOS/nixpkgs/issues/428077
|
||||
# Draft nixpkgs PR: https://github.com/NixOS/nixpkgs/pull/428353
|
||||
# When available, switch to pkgs.kdePackages.plasma-bigscreen.
|
||||
#
|
||||
# Upstream: https://invent.kde.org/plasma/plasma-bigscreen
|
||||
{
|
||||
mkKdeDerivation,
|
||||
lib,
|
||||
fetchFromGitLab,
|
||||
pkg-config,
|
||||
# KDE Frameworks 6
|
||||
ki18n,
|
||||
kdeclarative,
|
||||
kcmutils,
|
||||
knotifications,
|
||||
kio,
|
||||
kwayland,
|
||||
kwindowsystem,
|
||||
ksvg,
|
||||
kiconthemes,
|
||||
kglobalaccel,
|
||||
kdbusaddons,
|
||||
# KDE Plasma 6
|
||||
plasma-workspace,
|
||||
plasma-nano,
|
||||
plasma-nm,
|
||||
plasma-activities,
|
||||
plasma-activities-stats,
|
||||
milou,
|
||||
libkscreen,
|
||||
kdeconnect-kde,
|
||||
# Qt 6
|
||||
qtdeclarative, # needed for Qt6::QmlPrivate — see QCoro workaround in postPatch
|
||||
qtmultimedia,
|
||||
qtwebengine,
|
||||
# Other
|
||||
bluez-qt,
|
||||
qcoro,
|
||||
plasma-wayland-protocols,
|
||||
wayland,
|
||||
sdl3,
|
||||
}:
|
||||
|
||||
mkKdeDerivation {
|
||||
pname = "plasma-bigscreen";
|
||||
version = "unstable-2026-03-07";
|
||||
|
||||
src = fetchFromGitLab {
|
||||
domain = "invent.kde.org";
|
||||
owner = "plasma";
|
||||
repo = "plasma-bigscreen";
|
||||
rev = "bd143fea7e386bac1652b8150a3ed3d5ef7cf93c";
|
||||
hash = "sha256-y439IX7e0+XqxqFj/4+P5le0hA7DiwA+smDsD0UH/fI=";
|
||||
};
|
||||
|
||||
extraNativeBuildInputs = [
|
||||
pkg-config
|
||||
];
|
||||
|
||||
extraBuildInputs = [
|
||||
# KDE Frameworks
|
||||
ki18n
|
||||
kdeclarative
|
||||
kcmutils
|
||||
knotifications
|
||||
kio
|
||||
kwayland
|
||||
kwindowsystem
|
||||
ksvg
|
||||
kiconthemes
|
||||
kglobalaccel
|
||||
kdbusaddons
|
||||
# Plasma
|
||||
plasma-workspace
|
||||
plasma-nano
|
||||
plasma-nm
|
||||
plasma-activities
|
||||
plasma-activities-stats
|
||||
milou
|
||||
libkscreen
|
||||
kdeconnect-kde
|
||||
# Qt — qtdeclarative is needed for Qt6::QmlPrivate (see postPatch)
|
||||
qtdeclarative
|
||||
qtmultimedia
|
||||
qtwebengine
|
||||
# Other
|
||||
bluez-qt
|
||||
qcoro
|
||||
plasma-wayland-protocols
|
||||
wayland
|
||||
sdl3
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace bin/plasma-bigscreen-wayland.in \
|
||||
--replace @KDE_INSTALL_FULL_LIBEXECDIR@ "${plasma-workspace}/libexec"
|
||||
|
||||
# WORKAROUND: Plasma version numbers must match; we're building an
|
||||
# unreleased package against a stable Plasma release. Remove once
|
||||
# bigscreen is part of the Plasma release cycle.
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace-fail 'set(PROJECT_VERSION "6.5.80")' 'set(PROJECT_VERSION "${plasma-workspace.version}")'
|
||||
|
||||
# WORKAROUND: QCoro6Qml's cmake config links against Qt6::QmlPrivate but
|
||||
# doesn't call find_package to import the target. This is arguably a QCoro
|
||||
# packaging bug in nixpkgs (it should propagate qtdeclarative). Remove
|
||||
# once QCoro or the nixpkgs plasma-bigscreen package is fixed upstream.
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace-fail 'find_package(QCoro6' 'find_package(Qt6 ''${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS QmlPrivate)
|
||||
find_package(QCoro6'
|
||||
'';
|
||||
|
||||
preFixup = ''
|
||||
wrapQtApp $out/bin/plasma-bigscreen-wayland
|
||||
'';
|
||||
|
||||
passthru.providedSessions = [
|
||||
"plasma-bigscreen-wayland"
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Plasma shell for TVs (Plasma Bigscreen)";
|
||||
homepage = "https://plasma-bigscreen.org";
|
||||
license = lib.licenses.gpl2Plus;
|
||||
platforms = lib.platforms.linux;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user