Files
nixos-config/hosts/arrakis/default.nix
T
Miguel Palhas d417a27f2d
CI / lint (push) Successful in 31s
CI / eval (push) Successful in 2m1s
feat: make the clipboard work across tmux, ssh and hosts
tmux copy bindings piped to xclip, which is X11-only and never worked
under Hyprland or over SSH, and set-clipboard was never enabled, so the
vi-mode `y` binding was dead too. Route both through OSC 52 instead.
terminal-features has to name the outer terminal explicitly: tmux skips
OSC 52 silently when the terminfo entry does not claim the capability,
which is the common case for an SSH session on xterm-256color.

Neovim only falls back to OSC 52 when it finds no clipboard tool, but
wl-clipboard is installed on every host, so over SSH it wrote the remote
clipboard. Pin the OSC 52 provider for SSH sessions only.

Moonlight and Sunshine have no clipboard channel in the protocol, so
nothing at the terminal layer can help there. Add kdeconnect on all three
hosts for that, and start its indicator from Hyprland — kdeconnectd is
DBus-activated and nothing else brings it up at login.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-18 08:14:17 +01:00

87 lines
3.1 KiB
Nix

{
inputs,
pkgs,
...
}:
{
imports = [
inputs.hardware.nixosModules.dell-xps-13-9315
./hardware-configuration.nix
../common/global
../common/features/user.nix
../common/features/laptop.nix
../common/features/networking.nix
../common/features/gpu/intel-graphics.nix
../common/features/display
../common/features/pipewire.nix
../common/features/docker.nix
../common/features/appimage.nix
../common/features/fonts.nix
../common/features/kdeconnect.nix
../common/features/nix-ld.nix
../common/features/bluetooth.nix
../common/features/ledger.nix
../common/features/smb-mounts.nix
../common/features/home
];
networking.hostName = "arrakis";
# NAS media share — reachable only over the wg-home VPN. Lazy automount, so it
# never blocks boot and (re)mounts on first access once the VPN is up.
custom.smbMounts = [
{
server = "10.6.10.45";
share = "media";
mountPoint = "/mnt/media";
}
];
boot.kernelParams = [
"i915=force_probe=46a6"
"i915.enable_psr=0"
];
users.users.naps62.extraGroups = [ "video" ];
# IPU6 webcam (Dell XPS 9320, Alder Lake, ov01a10 sensor).
# Uses Intel's hardware ISP via the official hardware.ipu6 module: the
# proprietary HAL (ipu6-camera-bins/-hal + icamerasrc) feeds v4l2-relayd,
# which exposes a normal /dev/video50 ("Intel MIPI Camera") that works in
# every app (Chrome, Zen, mpv, OBS, ...). The module also hides the 32 raw
# IPU6 nodes from WirePlumber/udev, which is what unbreaks Chrome.
#
# The relay is on-demand (v4l2-relayd opens the sensor only when an app opens
# the loopback device), so the LED should follow usage rather than stay on.
#
# Bare libcamera still works as a fallback (software ISP, poor quality):
# libcamerify mpv av://v4l2:/dev/video0 --profile=low-latency --untimed
hardware.ipu6 = {
enable = true;
platform = "ipu6ep"; # Alder Lake / Raptor Lake
};
# v4l2-relayd exits whenever a consumer closes the loopback and relies on
# systemd to restart it for the next session. The default start-limit (5
# restarts / 10s) permanently kills it under rapid open/close (e.g. an app
# probing the device), leaving the camera dead until a manual restart.
# Disable the limit and throttle restarts so it always self-heals.
systemd.services.v4l2-relayd-ipu6 = {
startLimitIntervalSec = 0;
serviceConfig.RestartSec = "1";
};
# The module's rule to lock the raw IPU6 nodes to root gets clobbered by the
# default "video4linux -> group video" rule, so they stay user-readable and
# Chrome hangs enumerating all 32 of them. Re-assert with ':=' (locks the
# value against later rules), matched on the kernel-set ID_V4L_PRODUCT.
# GROUP/MODE alone isn't enough: logind's uaccess still leaves a stale
# "user:<you>:rw" ACL on the nodes, so also drop the uaccess tag and wipe any
# ACL on every event (setfacl -b) to keep the raw nodes truly root-only.
services.udev.extraRules = ''
SUBSYSTEM=="video4linux", ENV{ID_V4L_PRODUCT}=="ipu6", GROUP:="root", MODE:="0600", TAG-="uaccess", RUN+="${pkgs.acl}/bin/setfacl -b %N"
'';
services.fprintd.enable = true;
}