Add configs for installing sunshine (server) and moonlight (client).

This commit is contained in:
Tom Alexander
2026-10-06 17:29:31 -04:00
parent 3f57dd72c7
commit 4cc1da46be
5 changed files with 79 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
options.me = {
sunshine.enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Whether we want to install sunshine.";
};
};
config = lib.mkIf (config.me.sunshine.enable && config.me.graphical) {
environment.systemPackages = with pkgs; [
];
services.sunshine = {
enable = true;
autoStart = true;
# capSysAdmin = true; # Only needed on non-wlroots wayland compositors
openFirewall = true;
};
# Add user to uinput group to allow sunshine to create virtual input devices like mice/keyboards.
users.users.talexander = {
extraGroups = [ "uinput" ];
};
environment.persistence."/persist" = lib.mkIf (config.me.mountPersistence) {
hideMounts = true;
users.talexander = {
directories = [
{
directory = ".config/sunshine";
user = "talexander";
group = "talexander";
mode = "0755";
}
];
};
};
};
}