ark/modules/services/games/gamemode.nix

37 lines
810 B
Nix
Raw Normal View History

2020-06-18 05:14:37 +03:00
{ config, lib, options, pkgs, ... }:
with lib;
let cfg = config.services.gamemode;
in {
options.services.gamemode = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable the gamemoded systemd user service.
'';
};
};
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.gamemode ];
services.dbus.packages = [ pkgs.gamemode ];
systemd.user.services.gamemoded = {
description = "gamemoded";
serviceConfig = {
Type = "dbus";
BusName = "com.feralinteractive.GameMode";
NotifyAccess = "main";
ExecStart = "${pkgs.gamemode}/bin/gamemoded";
};
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
};
};
}