summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flake.lock119
-rw-r--r--flake.nix3
-rw-r--r--hosts/shinji/default.nix4
-rw-r--r--options.nix1
-rw-r--r--system/default.nix10
-rw-r--r--system/desktop.nix11
-rw-r--r--system/gaming/default.nix23
-rw-r--r--system/gaming/steam.nix1
8 files changed, 164 insertions, 8 deletions
diff --git a/flake.lock b/flake.lock
index efef6ef..9c59ddd 100644
--- a/flake.lock
+++ b/flake.lock
@@ -128,6 +128,22 @@
"locked": {
"lastModified": 1767039857,
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
+ "owner": "NixOS",
+ "repo": "flake-compat",
+ "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "repo": "flake-compat",
+ "type": "github"
+ }
+ },
+ "flake-compat_3": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1767039857,
+ "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
@@ -139,6 +155,24 @@
"type": "github"
}
},
+ "flake-parts": {
+ "inputs": {
+ "nixpkgs-lib": "nixpkgs-lib"
+ },
+ "locked": {
+ "lastModified": 1778716662,
+ "narHash": "sha256-m1Yf0wZ8j1OHjTc2UwHwyQRSnNeSgLJOd7q5Y45hzi4=",
+ "owner": "hercules-ci",
+ "repo": "flake-parts",
+ "rev": "f7c1a2d347e4c52d5fb8d10cb4d94b5884e546fb",
+ "type": "github"
+ },
+ "original": {
+ "owner": "hercules-ci",
+ "repo": "flake-parts",
+ "type": "github"
+ }
+ },
"flake-utils": {
"inputs": {
"systems": "systems_2"
@@ -157,6 +191,29 @@
"type": "github"
}
},
+ "git-hooks": {
+ "inputs": {
+ "flake-compat": "flake-compat_2",
+ "gitignore": "gitignore_2",
+ "nixpkgs": [
+ "nix-gaming",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1778507602,
+ "narHash": "sha256-kTwur1wV+01SdqskVMSo6JMEpg71ps3HpbFY2GsflKs=",
+ "owner": "cachix",
+ "repo": "git-hooks.nix",
+ "rev": "61ab0e80d9c7ab14c256b5b453d8b3fb0189ba0a",
+ "type": "github"
+ },
+ "original": {
+ "owner": "cachix",
+ "repo": "git-hooks.nix",
+ "type": "github"
+ }
+ },
"gitignore": {
"inputs": {
"nixpkgs": [
@@ -179,6 +236,28 @@
"type": "github"
}
},
+ "gitignore_2": {
+ "inputs": {
+ "nixpkgs": [
+ "nix-gaming",
+ "git-hooks",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1709087332,
+ "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
+ "owner": "hercules-ci",
+ "repo": "gitignore.nix",
+ "rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
+ "type": "github"
+ },
+ "original": {
+ "owner": "hercules-ci",
+ "repo": "gitignore.nix",
+ "type": "github"
+ }
+ },
"home-manager": {
"inputs": {
"nixpkgs": [
@@ -574,6 +653,28 @@
"type": "github"
}
},
+ "nix-gaming": {
+ "inputs": {
+ "flake-parts": "flake-parts",
+ "git-hooks": "git-hooks",
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1779682703,
+ "narHash": "sha256-+89u+znf0/h2ziuXzY4INyCF6AYqcMWD2LkEOJfUtQ0=",
+ "owner": "fufexan",
+ "repo": "nix-gaming",
+ "rev": "8358d46120803ea055fe8e3ce5934450d47f5292",
+ "type": "github"
+ },
+ "original": {
+ "owner": "fufexan",
+ "repo": "nix-gaming",
+ "type": "github"
+ }
+ },
"nixos-hardware": {
"locked": {
"lastModified": 1778143761,
@@ -592,7 +693,7 @@
},
"nixos-wsl": {
"inputs": {
- "flake-compat": "flake-compat_2",
+ "flake-compat": "flake-compat_3",
"nixpkgs": [
"nixpkgs"
]
@@ -627,6 +728,21 @@
"type": "github"
}
},
+ "nixpkgs-lib": {
+ "locked": {
+ "lastModified": 1777168982,
+ "narHash": "sha256-GOkGPcboWE9BmGCRMLX3worL4EMnsnG8MyKmXNeYuhQ=",
+ "owner": "nix-community",
+ "repo": "nixpkgs.lib",
+ "rev": "f5901329dade4a6ea039af1433fb087bd9c1fe14",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "repo": "nixpkgs.lib",
+ "type": "github"
+ }
+ },
"ny": {
"flake": false,
"locked": {
@@ -691,6 +807,7 @@
"hy3": "hy3",
"hyprland": "hyprland",
"hyprland-plugins": "hyprland-plugins",
+ "nix-gaming": "nix-gaming",
"nixos-hardware": "nixos-hardware",
"nixos-wsl": "nixos-wsl",
"nixpkgs": "nixpkgs",
diff --git a/flake.nix b/flake.nix
index 032a4f0..e41293a 100644
--- a/flake.nix
+++ b/flake.nix
@@ -33,6 +33,9 @@
# caelestia-shell
caelestia-shell.url = "git+https://g.freya.cat/caelestia-shell";
caelestia-shell.inputs.nixpkgs.follows = "nixpkgs";
+ # nix-gaming
+ nix-gaming.url = "github:fufexan/nix-gaming";
+ nix-gaming.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {
diff --git a/hosts/shinji/default.nix b/hosts/shinji/default.nix
index de2085c..6a4785e 100644
--- a/hosts/shinji/default.nix
+++ b/hosts/shinji/default.nix
@@ -48,9 +48,6 @@
# packages
environment.systemPackages = with pkgs; [
- # wine
- winetricks
- wineWow64Packages.staging
# android
android-tools
scrcpy
@@ -85,6 +82,7 @@
web.enable = true;
};
gaming = {
+ enable = true;
homestuck.enable = true;
minecraft.enable = true;
steam.enable = true;
diff --git a/options.nix b/options.nix
index 3a2f269..1e1d37c 100644
--- a/options.nix
+++ b/options.nix
@@ -511,6 +511,7 @@ in {
# Gaming programs to choose from
#
gaming = {
+ enable = mkEnableOption "Enable gaming optimizations";
homestuck.enable = mkEnableOption "Install the unofficial homestuck collection.";
minecraft.enable = mkEnableOption "Install the minecraft block game.";
steam.enable = mkEnableOption "Install the steam game launcher.";
diff --git a/system/default.nix b/system/default.nix
index 62c8306..4bb2809 100644
--- a/system/default.nix
+++ b/system/default.nix
@@ -10,6 +10,9 @@
in {
imports = [
inputs.home-manager.nixosModules.home-manager
+ inputs.nix-gaming.nixosModules.platformOptimizations
+ inputs.nix-gaming.nixosModules.pipewireLowLatency
+ inputs.nix-gaming.nixosModules.wine
./desktops
./gaming
./virt
@@ -51,6 +54,8 @@ in {
(_: _: inputs.hyprland.packages.${system})
(_: _: inputs.hyprland-plugins.packages.${system})
(_: _: inputs.hy3.packages.${system})
+ # gaming
+ (_: _: inputs.nix-gaming.packages.${system})
# misc
(_: _: inputs.talc.packages.${system})
(_: _: inputs.apple-fonts.packages.${system})
@@ -130,7 +135,10 @@ in {
};
# use the latest kernel
- boot.kernelPackages = pkgs.linuxPackages_latest;
+ boot.kernelPackages =
+ if config.gaming.enable
+ then pkgs.linuxPackages_xanmod_latest
+ else pkgs.linuxPackages_latest;
# sysrq
boot.kernel.sysctl."kernel.sysrq" = 246;
diff --git a/system/desktop.nix b/system/desktop.nix
index 0c26fa6..aec5ba8 100644
--- a/system/desktop.nix
+++ b/system/desktop.nix
@@ -27,12 +27,14 @@ in {
# gtk portal?
programs.dconf.enable = true;
- # audio / video
+ # audio
services.pipewire = {
enable = true;
alsa.enable = true;
+ alsa.support32Bit = config.gaming.enable;
pulse.enable = true;
jack.enable = true;
+ lowLatency.enable = config.gaming.enable;
wireplumber = {
enable = true;
extraConfig = {
@@ -44,8 +46,13 @@ in {
};
};
};
- hardware.graphics.enable = true;
users.groups.audio.members = [config.user];
+
+ # video
+ hardware.graphics = {
+ enable = true;
+ enable32Bit = config.gaming.enable;
+ };
users.groups.video.members = [config.user];
# scheduling
diff --git a/system/gaming/default.nix b/system/gaming/default.nix
index 734ece0..ac04c6f 100644
--- a/system/gaming/default.nix
+++ b/system/gaming/default.nix
@@ -1,5 +1,26 @@
-_: {
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}: let
+ inherit (lib) mkIf;
+ cfg = config.gaming;
+in {
imports = [
./steam.nix
];
+
+ config = mkIf cfg.enable {
+ programs.wine = {
+ enable = true;
+ package = pkgs.wineWow64Packages.staging;
+ binfmt = true;
+ ntsync = true;
+ };
+
+ environment.systemPackages = with pkgs; [
+ winetricks
+ ];
+ };
}
diff --git a/system/gaming/steam.nix b/system/gaming/steam.nix
index df65632..dd4fc50 100644
--- a/system/gaming/steam.nix
+++ b/system/gaming/steam.nix
@@ -26,6 +26,7 @@ in {
dedicatedServer.openFirewall = true;
localNetworkGameTransfers.openFirewall = true;
gamescopeSession.enable = true;
+ platformOptimizations.enable = config.gaming.enable;
# Fix new steam controller
extest.enable = true;