nixos/moonlight-qt: add module (#537882)

This commit is contained in:
Bjørn Forsman
2026-07-11 07:57:47 +00:00
committed by GitHub
4 changed files with 47 additions and 3 deletions
@@ -24,6 +24,8 @@
- [tranquil](https://tangled.org/tranquil.farm/tranquil-pds) is an ATProto PDS (personal data server) implementation in Rust. A featureful, spec conscious and community driven alternative to the Bluesky reference implementation PDS. Available as [services.tranquil-pds](#opt-services.tranquil-pds.enable).
- [Moonlight Qt](https://moonlight-stream.org/), a client for playing your PC games on almost any device. Available as [programs.moonlight-qt](#opt-programs.moonlight-qt.enable).
- [scx_loader](https://github.com/sched-ext/scx-loader), a system daemon and DBus-based loader for sched_ext schedulers. `scxctl` is the command-line client for interacting with the loader, allowing users to switch schedulers, modes, and arguments dynamically. Available as [services.scx-loader](#opt-services.scx-loader.enable)
- [tap](https://github.com/bluesky-social/indigo/tree/main/cmd/tap), an ATProtocol firehose synchronisation utility. Available as [services.tap](#opt-services.tap.enable).
+1
View File
@@ -268,6 +268,7 @@
./programs/mininet.nix
./programs/minipro.nix
./programs/miriway.nix
./programs/moonlight-qt.nix
./programs/mosh.nix
./programs/mouse-actions.nix
./programs/msmtp.nix
+39
View File
@@ -0,0 +1,39 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.moonlight-qt;
in
{
options.programs.moonlight-qt = {
enable = lib.mkEnableOption "Moonlight Qt, a client for playing your PC games on almost any device";
package = lib.mkPackageOption pkgs "moonlight-qt" { };
capSysNice = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Add the CAP_SYS_NICE capability to Moonlight Qt so that it may raise
its scheduling priority.
'';
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
security.wrappers.moonlight = lib.mkIf cfg.capSysNice {
owner = "root";
group = "root";
source = lib.getExe cfg.package;
capabilities = "cap_sys_nice+ep";
};
};
meta.maintainers = with lib.maintainers; [ aaravrav ];
}
+5 -3
View File
@@ -40,9 +40,10 @@
./common/x11.nix
];
environment.systemPackages = with pkgs; [
moonlight-qt
];
programs.moonlight-qt = {
enable = true;
capSysNice = true;
};
};
@@ -52,6 +53,7 @@
# start the tests, wait for sunshine to be up
start_all()
sunshine.wait_for_open_port(48010,"localhost")
moonlight.succeed("${pkgs.libcap}/bin/getcap \"$(command -v moonlight)\" | grep -q 'cap_sys_nice'")
# set the admin username/password, restart sunshine
sunshine.execute("sunshine --creds sunshine sunshine")