gaming: Add gaming-specific packages and settings

This commit is contained in:
PapaTutuWawa 2022-02-02 12:08:36 +01:00
parent 3bc1c21b4c
commit e80232bb39
3 changed files with 64 additions and 30 deletions

View File

@ -38,8 +38,8 @@
cantata
newsflash
sublime-music-no-test
psst
staruml-wrapped
anki
#psst
];
ptw = {
@ -59,10 +59,11 @@
enable = true;
output = "DP-2";
};
xournalpp.enable = true;
#xournalpp.enable = true;
zsh.enable = true;
office.enable = true;
#office.enable = true;
#plasma.enable = true;
gaming.enable = true;
};
services = {
gamemode.enable = true;
@ -113,6 +114,7 @@
};
virtualisation = {
enable = true;
gaming.enable = true;
};
};
programs = {
@ -134,12 +136,12 @@
options amdgpu dpm=0
'';
initrd = {
availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sd_mod" "amdgpu" ]; #"vendor-reset" ];
availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sd_mod" "amdgpu" "vendor-reset" ];
kernelModules = [
"amdgpu" # GPU (duh)
"kvm-amd" "vfio_virqfd" "vfio_pci" "vfio_iommu_type1" "vfio" # Virt
"uinput" # key-mapper
#"vendor-reset"
"vendor-reset"
];
};
kernelParams = [
@ -183,34 +185,51 @@
};
};
hardware = {
opentabletdriver.enable = true;
};
# TODO: Move into modules
systemd.user.services = {
scream = {
description = "Audio receiver for the Scream virtual network sound card";
#wantedBy = [ "default.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.scream}/bin/scream -i virbr0 -o pulse";
Restart = "always";
systemd = {
services = {
enable-vendor-reset = {
wantedBy = [ "default.target" ];
script = ''
echo "device_specific" > /sys/bus/pci/devices/0000:01:00.0/reset_method
'';
serviceConfig = {
Type = "simple";
};
};
};
replaysorcery-kms = {
description = "An open-source, instant-replay solution for Linux; KMS service";
#wantedBy = [ "default.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.replaysorcery}/bin/replay-sorcery kms-service";
Restart = "always";
user.services = {
scream = {
description = "Audio receiver for the Scream virtual network sound card";
#wantedBy = [ "default.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.scream}/bin/scream -i virbr0 -o pulse";
Restart = "always";
};
};
};
replaysorcery = {
description = "An open-source, instant-replay solution for Linux";
#wantedBy = [ "default.target" ];
requires = [ "replaysorcery-kms.service" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.replaysorcery}/bin/replay-sorcery";
Restart = "always";
replaysorcery-kms = {
description = "An open-source, instant-replay solution for Linux; KMS service";
#wantedBy = [ "default.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.replaysorcery}/bin/replay-sorcery kms-service";
Restart = "always";
};
};
replaysorcery = {
description = "An open-source, instant-replay solution for Linux";
#wantedBy = [ "default.target" ];
requires = [ "replaysorcery-kms.service" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.replaysorcery}/bin/replay-sorcery";
Restart = "always";
};
};
};
};

View File

@ -21,6 +21,7 @@
./programs/xournalpp
./programs/plasma
./programs/office
./programs/gaming
# Services
./services/kanshi

View File

@ -0,0 +1,14 @@
{ config, lib, pkgs, ... }:
let
cfg = config.ptw.programs.gaming;
in {
options.ptw.programs.gaming = {
enable = lib.mkEnableOption "Configure gaming options";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [
winePackages.stagingFull winetricks
];
};
}