mirror of
https://github.com/youwen5/nixos.git
synced 2025-01-17 20:52:09 -08:00
refactor: modularize gaming module and fold in hamachi
This commit is contained in:
parent
ee6f29eb57
commit
ddfcbd78c8
3 changed files with 64 additions and 49 deletions
|
@ -1,55 +1,75 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
ryujinx
|
||||
mangohud
|
||||
mangojuice
|
||||
];
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true;
|
||||
dedicatedServer.openFirewall = true;
|
||||
localNetworkGameTransfers.openFirewall = true;
|
||||
gamescopeSession.enable = true;
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.liminalOS.extras.gaming;
|
||||
in
|
||||
{
|
||||
options.liminalOS.extras.gaming = {
|
||||
enable = lib.mkEnableOption "gaming";
|
||||
withHamachi = lib.mkEnableOption "hamachi";
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
ryujinx
|
||||
lutris
|
||||
heroic
|
||||
mangohud
|
||||
mangojuice
|
||||
];
|
||||
|
||||
programs.gamescope.enable = true;
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true;
|
||||
dedicatedServer.openFirewall = true;
|
||||
localNetworkGameTransfers.openFirewall = true;
|
||||
gamescopeSession.enable = true;
|
||||
};
|
||||
|
||||
programs.gamemode = {
|
||||
enable = true;
|
||||
enableRenice = true;
|
||||
settings = {
|
||||
general = {
|
||||
renice = 10;
|
||||
};
|
||||
custom = {
|
||||
start = "${pkgs.libnotify}/bin/notify-send 'GameMode engaged'";
|
||||
end = "${pkgs.libnotify}/bin/notify-send 'GameMode disengaged'";
|
||||
programs.gamescope.enable = true;
|
||||
|
||||
programs.gamemode = {
|
||||
enable = true;
|
||||
enableRenice = true;
|
||||
settings = {
|
||||
general = {
|
||||
renice = 10;
|
||||
};
|
||||
custom = {
|
||||
start = "${pkgs.libnotify}/bin/notify-send 'GameMode engaged'";
|
||||
end = "${pkgs.libnotify}/bin/notify-send 'GameMode disengaged'";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
users.users.youwen.extraGroups = [ "gamemode" ];
|
||||
users.users.${config.liminalOS.username}.extraGroups = [ "gamemode" ];
|
||||
|
||||
nixpkgs.config.packageOverrides = pkgs: {
|
||||
steam = pkgs.steam.override {
|
||||
extraPkgs =
|
||||
pkgs: with pkgs; [
|
||||
xorg.libXcursor
|
||||
xorg.libXi
|
||||
xorg.libXinerama
|
||||
xorg.libXScrnSaver
|
||||
libpng
|
||||
libpulseaudio
|
||||
libvorbis
|
||||
stdenv.cc.cc.lib
|
||||
libkrb5
|
||||
(writeShellScriptBin "launch-gamescope" ''
|
||||
(sleep 1; pgrep gamescope| xargs renice -n -11 -p)&
|
||||
exec gamescope "$@"
|
||||
'')
|
||||
keyutils
|
||||
];
|
||||
services.logmein-hamachi.enable = cfg.withHamachi;
|
||||
programs.haguichi.enable = cfg.withHamachi;
|
||||
|
||||
nixpkgs.config.packageOverrides = pkgs: {
|
||||
steam = pkgs.steam.override {
|
||||
extraPkgs =
|
||||
pkgs: with pkgs; [
|
||||
xorg.libXcursor
|
||||
xorg.libXi
|
||||
xorg.libXinerama
|
||||
xorg.libXScrnSaver
|
||||
libpng
|
||||
libpulseaudio
|
||||
libvorbis
|
||||
stdenv.cc.cc.lib
|
||||
libkrb5
|
||||
(writeShellScriptBin "launch-gamescope" ''
|
||||
(sleep 1; pgrep gamescope| xargs renice -n -11 -p)&
|
||||
exec gamescope "$@"
|
||||
'')
|
||||
keyutils
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
services.logmein-hamachi.enable = true;
|
||||
programs.haguichi.enable = true;
|
||||
}
|
|
@ -12,7 +12,6 @@ in
|
|||
++ (with pkgs; [
|
||||
bitwarden-desktop
|
||||
modrinth-app
|
||||
lutris
|
||||
sbctl
|
||||
r2modman
|
||||
zoom-us
|
||||
|
|
Loading…
Reference in a new issue