nixos/moonlight-qt: add module

This commit is contained in:
aaravrav
2026-07-04 12:55:55 +05:30
parent e8273b29fe
commit 3b93c07201
4 changed files with 47 additions and 3 deletions
@@ -12,6 +12,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)
- [Nezha](https://github.com/nezhahq/nezha), a self-hosted, lightweight server and website monitoring and O&M tool. Available as [services.nezha](#opt-services.nezha.enable).
+1
View File
@@ -267,6 +267,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")