ark/modules/services/games/gamemode.nix

37 lines
800 B
Nix
Raw Normal View History

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