From e80232bb395ff0c217f118f45d2cf34ffdaf3f90 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Wed, 2 Feb 2022 12:08:36 +0100 Subject: [PATCH] gaming: Add gaming-specific packages and settings --- hosts/miku.nix | 79 ++++++++++++++++++----------- modules/default.nix | 1 + modules/programs/gaming/default.nix | 14 +++++ 3 files changed, 64 insertions(+), 30 deletions(-) create mode 100644 modules/programs/gaming/default.nix diff --git a/hosts/miku.nix b/hosts/miku.nix index 690bb3c..7fd5bd3 100644 --- a/hosts/miku.nix +++ b/hosts/miku.nix @@ -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"; + }; }; }; }; diff --git a/modules/default.nix b/modules/default.nix index c0e574e..0544e95 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -21,6 +21,7 @@ ./programs/xournalpp ./programs/plasma ./programs/office + ./programs/gaming # Services ./services/kanshi diff --git a/modules/programs/gaming/default.nix b/modules/programs/gaming/default.nix new file mode 100644 index 0000000..4c162ea --- /dev/null +++ b/modules/programs/gaming/default.nix @@ -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 + ]; + }; +}