Files
ryan4yin | 二花 c277c81cd6 feat(nixpak): sandbox six desktop apps (#497)
* feat(nixpak): sandbox six desktop apps

* chore(nixpak): trim OBS plugin set

* fix(nixpak): enable OBS on aarch64

* fix(nixpak): let imv read the full home directory

* fix(home): drop redundant freerdp package

* fix(nixpak): grant OBS access to V4L2 camera devices

* fix(nixpak): expose V4L2 sysfs to OBS

* fix(nixpak): expose NVIDIA encode library to OBS

* docs(nixpak): record OBS interactive validation

* docs(nixpak): record OBS RTMP validation

* fix(nixpak): run MuseScore via XWayland and PulseAudio

* docs(nixpak): explain app sandboxing rationale

* fix(nixpak): route MuseScore ALSA through PipeWire
2026-11-01 01:24:47 -05:00

71 lines
1.6 KiB
Nix

{
lib,
obs-studio,
obs-studio-plugins,
wrapOBS,
mkNixPak,
buildEnv,
makeDesktopItem,
runCommandLocal,
...
}:
let
appId = "com.obsproject.Studio";
package = wrapOBS.override { inherit obs-studio; } {
plugins = with obs-studio-plugins; [
# Wayland screen-capture fallback, per-application audio, and game capture.
wlrobs
obs-pipewire-audio-capture
obs-vkcapture
# Widely used scene, overlay and streaming plugins.
input-overlay
obs-multi-rtmp
obs-shaderfilter
obs-move-transition
obs-backgroundremoval
advanced-scene-switcher
];
};
wrapped = mkNixPak {
config = {
imports = [ ./modules/obs-policy.nix ];
app = {
inherit package;
binPath = "bin/obs";
};
flatpak = { inherit appId; };
};
};
exe = lib.getExe wrapped.config.script;
assets = runCommandLocal "obs-studio-desktop-assets" { } ''
mkdir -p $out/share
ln -s ${package}/share/icons $out/share/icons
'';
in
buildEnv {
inherit (wrapped.config.script) name passthru;
meta = wrapped.config.script.meta // {
mainProgram = "obs";
};
paths = [
wrapped.config.script
assets
(makeDesktopItem {
name = appId;
desktopName = "OBS Studio";
genericName = "Screen Recorder";
comment = "Record and stream the desktop";
exec = "${exe} %U";
icon = appId;
terminal = false;
startupNotify = true;
startupWMClass = "obs";
categories = [
"AudioVideo"
"Recorder"
];
extraConfig.X-Flatpak = appId;
})
];
}