43 lines
933 B
Nix
43 lines
933 B
Nix
{
|
|
lib,
|
|
config,
|
|
username,
|
|
pkgs,
|
|
...
|
|
}:
|
|
{
|
|
options = {
|
|
sunshine = {
|
|
enable = lib.mkEnableOption "Enable Sunshine in NixOS";
|
|
};
|
|
};
|
|
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";
|
|
}
|
|
];
|
|
};
|
|
};
|
|
home-manager.users.${username} = { };
|
|
};
|
|
}
|