Add configs for installing sunshine (server) and moonlight (client).
This commit is contained in:
@@ -65,6 +65,7 @@ in
|
||||
./roles/memtest86
|
||||
./roles/minimal_base
|
||||
./roles/mitmproxy
|
||||
./roles/moonlight
|
||||
./roles/network
|
||||
./roles/nix_index
|
||||
./roles/nix_repl
|
||||
@@ -95,6 +96,7 @@ in
|
||||
./roles/sshd
|
||||
./roles/steam
|
||||
./roles/steam_run_free
|
||||
./roles/sunshine
|
||||
./roles/sway
|
||||
./roles/tekton
|
||||
./roles/terraform
|
||||
|
||||
@@ -119,6 +119,7 @@
|
||||
me.media.enable = true;
|
||||
me.memtest.enable = true;
|
||||
me.mitmproxy.enable = true;
|
||||
me.moonlight.enable = true;
|
||||
me.network.enable = true;
|
||||
me.nix_index.enable = true;
|
||||
me.nix_repl.enable = true;
|
||||
|
||||
@@ -137,6 +137,7 @@
|
||||
me.sshd.enable = true;
|
||||
me.steam.enable = true;
|
||||
me.steam_run_free.enable = true;
|
||||
me.sunshine.enable = true;
|
||||
me.sway.enable = true;
|
||||
me.tekton.enable = true;
|
||||
me.terraform.enable = true;
|
||||
|
||||
25
nix/configuration/roles/moonlight/default.nix
Normal file
25
nix/configuration/roles/moonlight/default.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
options.me = {
|
||||
moonlight.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether we want to install moonlight.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.me.moonlight.enable && config.me.graphical) {
|
||||
environment.systemPackages = with pkgs; [
|
||||
moonlight-qt
|
||||
];
|
||||
};
|
||||
}
|
||||
50
nix/configuration/roles/sunshine/default.nix
Normal file
50
nix/configuration/roles/sunshine/default.nix
Normal 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";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user