streaming from imac now works

This commit is contained in:
Sebastian Moser
2025-09-07 03:41:22 +02:00
parent 73837c71cb
commit 0c04a03e26
9 changed files with 242 additions and 27 deletions

View File

@@ -8,7 +8,27 @@
# - win + D command # - win + D command
# - kernel output for luks pwd on all displays # - kernel output for luks pwd on all displays
{ lib, pkgs, nur, unstable, ... }: { { lib, pkgs, nur, unstable, ... }: let
# use sway from unstable, to have swayfx 0.5.3 to have sway 1.11 to have wlroots 0.19.0 to have ability to share individual windows
mySway = unstable.sway.overrideAttrs (prev: {
/*
src = pkgs.fetchFromGitHub {
owner = "WillPower3309";
repo = "swayfx";
rev = "";
hash = "";
};
*/
src = pkgs.fetchFromGitHub {
owner = "swaywm";
repo = "sway";
rev = "73c244fb4807a29c6599d42c15e8a8759225b2d6";
hash = "sha256-P2w1oRVUNBWajt8jZOxPXvBE29urbrhtORy+lfYqnF8=";
};
});
in {
services.greetd = { services.greetd = {
enable = true; enable = true;
@@ -22,7 +42,7 @@
export QT_QPA_PLATFORM=wayland export QT_QPA_PLATFORM=wayland
export XDG_CURRENT_DESKTOP=sway export XDG_CURRENT_DESKTOP=sway
export XDG_SESSION_DESKTOP=sway export XDG_SESSION_DESKTOP=sway
exec sway exec ${pkgs.lib.getExe mySway}
''}/bin/run-sway"; ''}/bin/run-sway";
user = "me"; user = "me";
}; };
@@ -30,6 +50,32 @@
}; };
}; };
systemd.user.services.xdg-desktop-portal-wlr.serviceConfig.ExecStart = let
settingsFormat = pkgs.formats.ini { };
configFile = settingsFormat.generate "xdg-desktop-portal-wlr.ini" {
screencast = {
output_name = "eDP-1";
# to make streaming of individual windows work
chooser_type = "dmenu";
chooser_cmd = "${lib.getExe pkgs.bemenu}";
};
};
package = pkgs.xdg-desktop-portal-wlr.overrideAttrs (prev: {
src = pkgs.fetchFromGitHub {
owner = "emersion";
repo = "xdg-desktop-portal-wlr";
rev = "b3703cceea485972b139c22342bdc2ed7b80c1c2";
sha256 = "sha256-nFAp/9ofRH4kIFgg2SjzZNXYu8r0BBjO5VPFc3jKeas=";
};
});
in [
# Empty ExecStart value to override the field
""
"${package}/libexec/xdg-desktop-portal-wlr --config=${configFile}"
];
security.rtkit.enable = true; security.rtkit.enable = true;
services.pipewire = { services.pipewire = {
enable = true; enable = true;
@@ -48,13 +94,10 @@
default = "wlr"; default = "wlr";
}; };
}; };
wlr.enable = true; extraPortals = [
wlr.settings.screencast = { pkgs.xdg-desktop-portal-gtk
output_name = "eDP-1"; pkgs.xdg-desktop-portal-wlr
chooser_type = "simple"; ];
chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or";
};
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
}; };
fonts.packages = with pkgs; [ fonts.packages = with pkgs; [
@@ -105,11 +148,12 @@
})) }))
*/ */
bemenu
xdg-desktop-portal xdg-desktop-portal
wlr-randr wlr-randr
rofi-wayland rofi-wayland
wev wev
swayfx
wl-clipboard wl-clipboard
zoxide zoxide
@@ -285,8 +329,12 @@
### Key bindings ### Key bindings
#bindsym Mod4+Shift+Return exec $term # QuickLaunch
bindsym $mod exec alacritty bindsym $mod+i mode "QuickLaunch"
mode QuickLaunch {
bindsym $mod+f exec alacritty; mode "default"
bindsym Escape mode "default"
}
bindsym --locked $mod+d exec wlr-randr --output eDP-1 --on bindsym --locked $mod+d exec wlr-randr --output eDP-1 --on
bindsym --locked $mod+Shift+d exec wlr-randr --output eDP-1 --off bindsym --locked $mod+Shift+d exec wlr-randr --output eDP-1 --off

View File

@@ -430,6 +430,10 @@
user = "server"; user = "server";
port = 49388; port = 49388;
}; };
ocih = {
hostname = "152.67.70.13";
user = "ubuntu";
};
}; };
}; };
}; };
@@ -505,7 +509,7 @@
}; };
path = with pkgs; [ curl bash socat borgbackup openssh ]; path = with pkgs; [ curl bash socat borgbackup openssh ];
serviceConfig = { serviceConfig = {
ExecStart = "/home/borgs/backups/fusu-ocih.sh"; ExecStart = "/home/borgs/backups/ocih.sh";
User = "borgs"; User = "borgs";
Group = "borgs"; Group = "borgs";
WorkingDirectory = "/home/borgs/backups"; WorkingDirectory = "/home/borgs/backups";

View File

@@ -1,4 +1,4 @@
{ lib, secretsDir, pkgs, inputs, ... }: let { lib, secretsDir, pkgs, inputs, unstable, ... }: let
myobs = pkgs.wrapOBS { myobs = pkgs.wrapOBS {
plugins = with pkgs.obs-studio-plugins; [ plugins = with pkgs.obs-studio-plugins; [
@@ -22,6 +22,7 @@ in {
../common/nixos-wayland.nix ../common/nixos-wayland.nix
]; ];
services.tailscale.enable = true; services.tailscale.enable = true;
programs.nix-ld.enable = true;
networking.hostName = "mac"; networking.hostName = "mac";
networking.firewall.enable = false; networking.firewall.enable = false;
@@ -172,20 +173,56 @@ in {
]; ];
#services.greetd.enable = lib.mkForce false;
services.greetd = lib.mkForce { services.greetd = lib.mkForce {
enable = true; enable = true;
settings = rec { settings = rec {
terminal.vt = 2; terminal.vt = 1;
initial_session = { initial_session = let
command = "${pkgs.writeScriptBin "run-sway" ''
newerUnstableSrc = builtins.getFlake "nixpkgs/d0fc30899600b9b3466ddb260fd83deb486c32f1";
newerUnstable = import newerUnstableSrc.outPath {};
mySway = newerUnstable.sway.override {
sway-unwrapped = (newerUnstable.sway-unwrapped.overrideAttrs (prev: {
/*
src = pkgs.fetchFromGitHub {
owner = "WillPower3309";
repo = "swayfx";
rev = "";
hash = "";
};
*/
src = pkgs.fetchFromGitHub {
owner = "swaywm";
repo = "sway";
rev = "73c244fb4807a29c6599d42c15e8a8759225b2d6";
hash = "sha256-P2w1oRVUNBWajt8jZOxPXvBE29urbrhtORy+lfYqnF8=";
};
})).override {
wlroots = newerUnstable.wlroots.overrideAttrs (prev: {
version = "master";
src = pkgs.fetchFromGitLab {
domain = "gitlab.freedesktop.org";
owner = "wlroots";
repo = "wlroots";
rev = "master";
sha256 = "sha256-2FK6FGRpgf/YYqwJST0LVA/pnNRSUDrfrrp6mSwA0Fk=";
};
});
};
};
in {
#command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time -d --env WLR_RENDERER_ALLOW_SOFTWARE=1 --cmd sway";
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd ${pkgs.writeScriptBin "run-sway" ''
export WLR_RENDERER_ALLOW_SOFTWARE=1 export WLR_RENDERER_ALLOW_SOFTWARE=1
export SDL_VIDEODRIVER=wayland export SDL_VIDEODRIVER=wayland
export _JAVA_AWT_WM_NONREPARENTING=1 export _JAVA_AWT_WM_NONREPARENTING=1
export QT_QPA_PLATFORM=wayland export QT_QPA_PLATFORM=wayland
export XDG_CURRENT_DESKTOP=sway export XDG_CURRENT_DESKTOP=sway
export XDG_SESSION_DESKTOP=sway export XDG_SESSION_DESKTOP=sway
exec sway > /tmp/sway-log 2>&1 exec ${pkgs.lib.getExe mySway}
''}/bin/run-sway"; ''}/bin/run-sway";
user = "me"; user = "me";
}; };
@@ -193,6 +230,56 @@ in {
}; };
}; };
systemd.services."sway@" = let
mySway = unstable.sway.overrideAttrs (prev: {
/*
src = pkgs.fetchFromGitHub {
owner = "WillPower3309";
repo = "swayfx";
rev = "";
hash = "";
};
*/
src = pkgs.fetchFromGitHub {
owner = "swaywm";
repo = "sway";
rev = "73c244fb4807a29c6599d42c15e8a8759225b2d6";
hash = "sha256-P2w1oRVUNBWajt8jZOxPXvBE29urbrhtORy+lfYqnF8=";
};
});
in {
enable = false;
after = [ "systemd-user-sessions.service" "dbus.socket" "systemd-logind.service" "getty@%i.service" "plymouth-deactivate.service" "plymouth-quit.service" ];
before = [ "graphical.target" ];
wants = [ "dbus.socket" "systemd-logind.service" "plymouth-deactivate.service" ];
wantedBy = [ "graphical.target" ];
conflicts = [ "getty@%i.service" ]; # "plymouth-quit.service" "plymouth-quit-wait.service"
restartIfChanged = false;
serviceConfig = {
ExecStart = "${lib.getExe mySway}";
User = "me";
# ConditionPathExists = "/dev/tty0";
IgnoreSIGPIPE = "no";
# Log this user with utmp, letting it show up with commands 'w' and
# 'who'. This is needed since we replace (a)getty.
UtmpIdentifier = "%I";
UtmpMode = "user";
# A virtual terminal is needed.
TTYPath = "/dev/%I";
TTYReset = "yes";
TTYVHangup = "yes";
TTYVTDisallocate = "yes";
# Fail to start if not controlling the virtual terminal.
#StandardInput = "tty-fail";
#StandardOutput = "syslog";
#StandardError = "syslog";
# Set up a full (custom) user session for the user, required by Cage.
PAMName = "cage";
};
};
systemd.extraConfig = "DefaultLimitNOFILE=2048"; systemd.extraConfig = "DefaultLimitNOFILE=2048";
@@ -210,7 +297,7 @@ in {
hardware.enableRedistributableFirmware = true; hardware.enableRedistributableFirmware = true;
systemd.services."cage@" = { systemd.services."cage@" = {
enable = true; enable = false;
after = [ "systemd-user-sessions.service" "dbus.socket" "systemd-logind.service" "getty@%i.service" "plymouth-deactivate.service" "plymouth-quit.service" ]; after = [ "systemd-user-sessions.service" "dbus.socket" "systemd-logind.service" "getty@%i.service" "plymouth-deactivate.service" "plymouth-quit.service" ];
before = [ "graphical.target" ]; before = [ "graphical.target" ];
wants = [ "dbus.socket" "systemd-logind.service" "plymouth-deactivate.service" ]; wants = [ "dbus.socket" "systemd-logind.service" "plymouth-deactivate.service" ];

View File

@@ -35,6 +35,16 @@
#services.openssh.enable = true; #services.openssh.enable = true;
programs.obs-studio = {
enable = true;
enableVirtualCamera = true;
plugins = with pkgs.obs-studio-plugins; [
droidcam-obs
obs-ndi
obs-teleport
];
};
# virtual display # virtual display
hardware.display = { hardware.display = {
@@ -257,13 +267,6 @@
slurp # screenshot functionality slurp # screenshot functionality
wl-clipboard # wl-copy and wl-paste for copy/paste from stdin / stdout wl-clipboard # wl-copy and wl-paste for copy/paste from stdin / stdout
mako # notification system developed by swaywm maintainer mako # notification system developed by swaywm maintainer
(pkgs.wrapOBS {
plugins = with obs-studio-plugins; [
obs-ndi
obs-teleport
];
})
(writeShellScriptBin "davinci" '' (writeShellScriptBin "davinci" ''
NIXPKGS_ALLOW_UNFREE=1 OCL_ICD_ENABLE_TRACE=True QT_QPA_PLATFORM=xcb nix run nixpkgs#davinci-resolve --impure -L NIXPKGS_ALLOW_UNFREE=1 OCL_ICD_ENABLE_TRACE=True QT_QPA_PLATFORM=xcb nix run nixpkgs#davinci-resolve --impure -L
'') '')

View File

@@ -0,0 +1,2 @@
{ pkgs, ... }: {
}

View File

@@ -0,0 +1,52 @@
{ stdenv
, fetchurl
, p7zip
# wether to build the version to be used with Xorg or not Xorg (eg wayland)
, forXorg ? false
, ...
}: let
nameExtension = (
if stdenv.isx86_64 or stdenv.isx86_32
then "x"
else if stdenv.isAarch64 or stdenv.isAarch32 or stdenv.isMips
then "ma"
else builtins.throw "unsupported system" ""
);
fileName = "eGTouch_v2.5.13219.L-${nameExtension}";
pathArch =
if stdenv.isAarch64 then "eGTouchAARCH64"
else builtins.throw "unsupported arch..." "";
pathBackend =
if forXorg then "${pathArch}withX"
else "${pathArch}nonX";
in stdenv.mkDerivation rec {
version = "2.5";
pname = "eGTouch";
nativeBuildInputs = [
p7zip # to unpack the src
];
# there are seperate tarballs... one for x86 and one for arm andmips
src = fetchurl {
url = "https://www.eeti.com/touch_driver/Linux/20240510/${fileName}.7z";
hash =
if nameExtension == "x"
then "sha256-zZlM4finrnvtxBmqKm4Sl0zQeFz/7yCTuTjXEwmolVI="
else "";
};
unpackPhase = ''
7z x $src
'';
installPhase = ''
mkdir -p $out/bin
cp ./${fileName}/${pathArch}/${pathBackend}/eGTouch $out/bin
'';
}

View File

@@ -14,6 +14,8 @@ in pkgs.lib.attrsets.genAttrs names (name: (pkgs.callPackage "${pwd}/mods/nurPkg
imap-backup = pkgs.callPackage ./mods/imap-backup/package.nix {}; imap-backup = pkgs.callPackage ./mods/imap-backup/package.nix {};
eGTouch = pkgs.callPackage ./mods/eGTouch-driver/pkg.nix {};
/* fails for nur evaluations /* fails for nur evaluations
iio-hyprland = let iio-hyprland = let
repo = pkgs.fetchFromGitHub { repo = pkgs.fetchFromGitHub {

View File

@@ -46,6 +46,8 @@
mize="~/work/mize/mize"; mize="~/work/mize/mize";
m="~/work/mize/mize"; m="~/work/mize/mize";
c2="~/work/c2-system/target/debug/system-c2-cli";
ports = "${pkgs.lsof}/bin/lsof -i -P -n"; ports = "${pkgs.lsof}/bin/lsof -i -P -n";
losetup = "${pkgs.util-linux}/bin/losetup"; losetup = "${pkgs.util-linux}/bin/losetup";
u = "sudo umount ~/mnt"; u = "sudo umount ~/mnt";
@@ -154,6 +156,11 @@
then then
xfreerdp /u:"me" /v:192.168.122.141 /p:$(cat /home/me/secrets/win-vm-pwd) /dynamic-resolution +clipboard +auto-reconnect +home-drive /wm-class:"Microsoft Windows"; xfreerdp /u:"me" /v:192.168.122.141 /p:$(cat /home/me/secrets/win-vm-pwd) /dynamic-resolution +clipboard +auto-reconnect +home-drive /wm-class:"Microsoft Windows";
elif [[ "$host" == "phone" ]]
then
ssh phone "source ~/.bashrc && on"
${pkgs.rustdesk}/bin/rustdesk --connect 100.77.80.77
fi fi
} }
complete -W "mosatop acern" rp complete -W "mosatop acern" rp

View File

@@ -14,7 +14,16 @@
../../programs/zathura.nix ../../programs/zathura.nix
../../programs/firefox/default.nix ../../programs/firefox/default.nix
inputs.lan-mouse.homeManagerModules.default inputs.lan-mouse.homeManagerModules.default
"${inputs.vscode-server}/modules/vscode-server/home.nix"
]; ];
services.vscode-server.enable = true;
programs.vscode.enable = true;
programs.vscode.extensions = with pkgs.vscode-extensions; [
ms-vscode-remote.remote-ssh
ms-vscode-remote.remote-ssh-edit
];
programs.lan-mouse.systemd = true; programs.lan-mouse.systemd = true;
@@ -81,6 +90,7 @@
# gui packages # gui packages
songrec
obsidian obsidian
eog eog
xorg.xkbcomp xorg.xkbcomp