feat: refactor, update settings for sunshine (#215)

This commit is contained in:
Ryan Yin
2025-08-20 22:12:43 +08:00
committed by GitHub
parent bccd5475df
commit 5c236517bc
11 changed files with 64 additions and 56 deletions

View File

@@ -1,4 +1,4 @@
{myvars, ...}:
{ myvars, lib, ... }:
#############################################################
#
# Ai - my main computer, with NixOS + I5-13600KF + RTX 4090 GPU, for gaming & daily use.
@@ -11,7 +11,8 @@ let
inherit (myvars.networking.hostsAddr.${hostName}) iface ipv4 ipv6;
ipv4WithMask = "${ipv4}/24";
ipv6WithMask = "${ipv6}/64";
in {
in
{
imports = [
./netdev-mount.nix
# Include the results of the hardware scan.
@@ -23,6 +24,8 @@ in {
./secureboot.nix
];
services.sunshine.enable = lib.mkForce true;
networking = {
inherit hostName;
@@ -35,7 +38,7 @@ in {
systemd.network.enable = true;
systemd.network.networks."10-${iface}" = {
matchConfig.Name = [iface];
matchConfig.Name = [ iface ];
networkConfig = {
Address = [
ipv4WithMask

View File

@@ -1,4 +1,4 @@
{ config, ... }:
{ config, lib, ... }:
{
# ===============================================================================================
# for Nvidia GPU
@@ -38,4 +38,11 @@
# };
})
];
services.sunshine.settings = {
max_bitrate = 20000; # in Kbps
# NVIDIA NVENC Encoder
nvenc_preset = 3; # 1(fastest + worst quality) - 7(slowest + best quality)
nvenc_twopass = "full_res"; # quarter_res / full_res.
};
}