lifetracker/modules/apps/sunshine/default.nix

52 lines
1.1 KiB
Nix

{
lib,
config,
username,
host,
pkgs,
...
}:
{
options = {
sunshine = {
enable = lib.mkEnableOption "Enable Sunshine in NixOS";
output = lib.mkOption {
type = lib.types.int;
default = 0;
};
};
};
config = lib.mkIf config.sunshine.enable {
services.sunshine = {
enable = true;
autoStart = true;
capSysAdmin = true;
openFirewall = true;
applications = {
env = {
PATH = "$(PATH):/run/current-system/sw/bin:/etc/profiles/per-user/${username}/bin:$(HOME)/.local/bin";
};
apps = [
{
name = "Desktop";
image-path = "desktop.png";
}
{
name = "Steam Big Picture";
image-path = "steam.png";
detached = [ "steam steam://open/bigpicture" ];
auto-detach = "true";
wait-all = "true";
exit-timeout = "5";
}
];
};
settings = {
sunshine_name = "${config.networking.hostName}";
output_name = config.sunshine.output;
};
};
home-manager.users.${username} = { };
};
}