os/modules/services/games/gamemode.nix

37 lines
800 B
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
2020-06-18 02:14:37 +00:00
with lib;
let cfg = config.services.gamemode;
2020-07-31 04:17:28 +00:00
in
{
2020-06-18 02:14:37 +00:00
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" ];
};
};
}