Skip to content

Commit

Permalink
add nix-gaming
Browse files Browse the repository at this point in the history
  • Loading branch information
joinemm committed Apr 12, 2024
1 parent e5db0b4 commit 5ecb902
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 21 deletions.
60 changes: 59 additions & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
url = "github:joinemm/bin";
inputs.nixpkgs.follows = "nixpkgs";
};

nix-gaming = {
url = "github:fufexan/nix-gaming";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = inputs @ {
Expand Down
57 changes: 39 additions & 18 deletions modules/gaming.nix
Original file line number Diff line number Diff line change
@@ -1,36 +1,57 @@
{pkgs, ...}: {
{
pkgs,
inputs,
...
}: {
imports = [
inputs.nix-gaming.nixosModules.platformOptimizations
];

programs = {
steam.enable = true;
steam = {
enable = true;
platformOptimizations.enable = true;
extraCompatPackages = with pkgs; [
proton-ge-bin
];
};

gamemode.enable = true;

# for minecraft
java.enable = true;
};

hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
hardware = {
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;

# better for steam proton games
systemd.extraConfig = "DefaultLimitNOFILE=1048576";
# Add opengl/vulkan support
extraPackages = with pkgs; [
libva
];
};

# Add opengl/vulkan support
hardware.opengl.extraPackages = with pkgs; [
libva
];

# Xbox wireless controller driver
hardware.xone.enable = true;
# Xbox wireless controller driver
xone.enable = true;
};

environment.systemPackages = with pkgs; [
# vulkan
vulkan-tools
vulkan-loader
vulkan-validation-layers
vulkan-extension-layer
# open source minecraft launcher
prismlauncher

prismlauncher # open source minecraft launcher
protontricks
mangohud
];

environment.sessionVariables = {
MANGOHUD = "1";
MANGOHUD_DLSYM = "1";
};
}
3 changes: 3 additions & 0 deletions modules/gui.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
autoRepeatDelay = 300;
autoRepeatInterval = 25;

# I don't need xterm
excludePackages = [pkgs.xterm];

# use startx as a display manager
displayManager.startx.enable = true;
libinput = {
Expand Down
6 changes: 4 additions & 2 deletions modules/nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
nix = {
settings = {
substituters = [
"https://cache.vedenemo.dev"
"https://numtide.cachix.org"
"https://nix-gaming.cachix.org"
"https://cache.vedenemo.dev"
];
trusted-public-keys = [
"cache.vedenemo.dev:8NhplARANhClUSWJyLVk4WMyy1Wb4rhmWW2u8AejH9E="
"numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE="
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
"cache.vedenemo.dev:8NhplARANhClUSWJyLVk4WMyy1Wb4rhmWW2u8AejH9E="
];

trusted-users = ["root" "@wheel"];
Expand Down

0 comments on commit 5ecb902

Please sign in to comment.