feat(desktop): move desktop services config to nixos modules
This commit is contained in:
parent
3040105f9c
commit
527a166a86
6 changed files with 98 additions and 114 deletions
52
modules/nixos/desktop/services/default.nix
Normal file
52
modules/nixos/desktop/services/default.nix
Normal file
|
@ -0,0 +1,52 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
inherit (lib)
|
||||
mkMerge
|
||||
singleton
|
||||
mkEnableOption
|
||||
mkIf
|
||||
;
|
||||
cfg = config.desktop.services;
|
||||
in
|
||||
{
|
||||
options.desktop.services = {
|
||||
spotifyd.enable = mkEnableOption "";
|
||||
sunshine.enable = mkEnableOption "";
|
||||
steam.enable = mkEnableOption "";
|
||||
};
|
||||
|
||||
config = mkMerge [
|
||||
(mkIf cfg.sunshine.enable {
|
||||
services.sunshine = {
|
||||
enable = true;
|
||||
capSysAdmin = true;
|
||||
openFirewall = true;
|
||||
settings = {
|
||||
sunshine_name = config.system.hostname;
|
||||
origin_web_ui_allowed = "wan";
|
||||
};
|
||||
applications = { };
|
||||
};
|
||||
home-manager.sharedModules = singleton { persistDirs = singleton ".config/sunshine"; };
|
||||
})
|
||||
(mkIf cfg.spotifyd.enable {
|
||||
networking.firewall.allowedTCPPorts = [ 5353 ];
|
||||
networking.firewall.allowedUDPPorts = [ 5353 ];
|
||||
home-manager.sharedModules = singleton {
|
||||
services.spotifyd.enable = true;
|
||||
services.spotifyd.settings.global = {
|
||||
device_name = "${config.system.hostname}";
|
||||
device_type = "computer";
|
||||
zeroconf_port = 5353;
|
||||
};
|
||||
};
|
||||
})
|
||||
(mkIf cfg.steam.enable {
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
gamescopeSession.enable = true;
|
||||
};
|
||||
home-manager.sharedModules = singleton { persistDirs = singleton ".local/share/Steam"; };
|
||||
})
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue