diff --git a/home/arrakis/default.nix b/home/arrakis/default.nix index 47433b7..a249018 100644 --- a/home/arrakis/default.nix +++ b/home/arrakis/default.nix @@ -14,11 +14,15 @@ ../common/features/downloads-cleanup.nix ../common/programs/3d.nix ../common/programs/godot.nix + ../common/programs/gaming ./monitors.nix ]; custom.hyprland.cursorSize = 32; + # Moonlight: client for the Sunshine server on konishi (stream games to this laptop). + custom.gaming.moonlight = true; + wayland.windowManager.hyprland.settings = { exec-once = [ ]; diff --git a/home/common/programs/gaming.nix b/home/common/programs/gaming/default.nix similarity index 89% rename from home/common/programs/gaming.nix rename to home/common/programs/gaming/default.nix index 7351b93..5db9889 100644 --- a/home/common/programs/gaming.nix +++ b/home/common/programs/gaming/default.nix @@ -9,10 +9,16 @@ # deliberately small. The host still owns the privileged pieces (Steam FHS # wrapper, Sunshine, gamemode, gamescope caps) under # hosts/common/features/gaming. +# +# Per-host segregation is by option: a host imports this module and enables only +# the pieces it wants (e.g. a laptop enables `moonlight` for streaming without +# the full `enable` launcher/Proton toolkit). let cfg = config.custom.gaming; in { + imports = [ ./moonlight.nix ]; + options.custom.gaming = { enable = lib.mkEnableOption "user-space gaming tools (launchers, Proton mgmt, MangoHud)"; diff --git a/home/common/programs/gaming/moonlight.nix b/home/common/programs/gaming/moonlight.nix new file mode 100644 index 0000000..70db8c6 --- /dev/null +++ b/home/common/programs/gaming/moonlight.nix @@ -0,0 +1,26 @@ +{ + config, + lib, + pkgs, + ... +}: +# Moonlight — client counterpart to the Sunshine host +# (hosts/common/features/gaming/sunshine.nix). User-space, so it lives here in +# the home gaming module rather than next to the Sunshine service. +# +# Gated by its own option, independent of `custom.gaming.enable`: a laptop can +# install just the streaming client without the full launcher/Proton toolkit. +# +# First run: launch `moonlight`, then pair to the Sunshine host by entering the +# PIN Moonlight shows into Sunshine's web UI (https://:47990). Moonlight +# discovers hosts on the LAN via Sunshine's mDNS. +let + cfg = config.custom.gaming; +in +{ + options.custom.gaming.moonlight = lib.mkEnableOption "Moonlight game-streaming client"; + + config = lib.mkIf cfg.moonlight { + home.packages = [ pkgs.moonlight-qt ]; + }; +} diff --git a/home/konishi/default.nix b/home/konishi/default.nix index 3723cab..f19fbd5 100644 --- a/home/konishi/default.nix +++ b/home/konishi/default.nix @@ -12,7 +12,7 @@ ../common/programs/ethui.nix ../common/programs/3d.nix ../common/programs/godot.nix - ../common/programs/gaming.nix + ../common/programs/gaming ../common/features/xdg.nix ../common/features/downloads-cleanup.nix ./monitors.nix