51 lines
1.1 KiB
Nix
51 lines
1.1 KiB
Nix
{
|
|
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";
|
|
}
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|