feat(nixosModules/desktop): enable sunshine

This commit is contained in:
Mohammad Rafiq 2025-05-25 20:29:09 +08:00
parent 1a45001401
commit 70814354aa
No known key found for this signature in database
3 changed files with 21 additions and 6 deletions

View file

@ -24,6 +24,7 @@
enableSpotifyd = lib.mkEnableOption "";
enableSteam = lib.mkEnableOption "";
enableVR = lib.mkEnableOption "";
enableSunshine = lib.mkEnableOption "";
};
config = lib.mkMerge [
@ -40,5 +41,16 @@
};
environment.systemPackages = [ pkgs.android-tools ];
})
(lib.mkIf config.desktop.enableSunshine {
services.sunshine = {
enable = true;
capSysAdmin = true;
openFirewall = true;
settings = {
sunshine_name = config.system.hostname;
};
applications = { };
};
})
];
}

View file

@ -6,13 +6,15 @@
}:
{
config = lib.mkIf (config.hardware.gpu == "nvidia") {
hardware.graphics.enable = true;
hardware.graphics.extraPackages = with pkgs; [
nvidia-vaapi-driver
];
hardware = {
graphics.enable = true;
graphics.extraPackages = with pkgs; [
nvidia-vaapi-driver
];
nvidia.open = true;
nvidia.package = config.boot.kernelPackages.nvidiaPackages.latest;
};
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia.open = true;
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.latest;
nixpkgs.config.allowUnfree = true;
environment.variables = {
LIBVA_DRIVER_NAME = "nvidia";