summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flake.lock17
-rw-r--r--flake.nix16
-rw-r--r--hosts/hardware-configuration-desktop.nix8
-rw-r--r--modules/gaming.nix4
4 files changed, 40 insertions, 5 deletions
diff --git a/flake.lock b/flake.lock
index 10eb559..55fb9b3 100644
--- a/flake.lock
+++ b/flake.lock
@@ -129,11 +129,28 @@
"type": "github"
}
},
+ "nixpkgs-mesa-pin": {
+ "locked": {
+ "lastModified": 1758035966,
+ "narHash": "sha256-qqIJ3yxPiB0ZQTT9//nFGQYn8X/PBoJbofA7hRKZnmE=",
+ "owner": "nixos",
+ "repo": "nixpkgs",
+ "rev": "8d4ddb19d03c65a36ad8d189d001dc32ffb0306b",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nixos",
+ "ref": "nixos-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
"root": {
"inputs": {
"eko": "eko",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs",
+ "nixpkgs-mesa-pin": "nixpkgs-mesa-pin",
"sops-nix": "sops-nix",
"zen-browser": "zen-browser"
}
diff --git a/flake.nix b/flake.nix
index f449c9d..8fc3b6c 100644
--- a/flake.nix
+++ b/flake.nix
@@ -23,9 +23,11 @@
url = "github:kyren223/eko/";
inputs.nixpkgs.follows = "nixpkgs";
};
+
+ nixpkgs-mesa-pin.url = "github:nixos/nixpkgs/nixos-unstable";
};
- outputs = { self, nixpkgs, ... }@inputs: {
+ outputs = { self, nixpkgs, nixpkgs-mesa-pin, ... }@inputs: {
nixosConfigurations = {
laptop = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
@@ -39,9 +41,17 @@
./hosts/lapsktop.nix
];
};
- kyren-desktop = nixpkgs.lib.nixosSystem {
+ # kyren-desktop = nixpkgs.lib.nixosSystem {
+ # system = "x86_64-linux";
+ # specialArgs = { inherit inputs; };
+ # modules = [
+ # ./hosts/desktop.nix
+ # ];
+ # };
+
+ kyren-desktop = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
- specialArgs = { inherit inputs; };
+ specialArgs = { inherit inputs; pkgs-mesa-pin = import nixpkgs-mesa-pin { inherit system; config.allowUnfree = true; }; };
modules = [
./hosts/desktop.nix
];
diff --git a/hosts/hardware-configuration-desktop.nix b/hosts/hardware-configuration-desktop.nix
index 2d93fb2..7c6ddb7 100644
--- a/hosts/hardware-configuration-desktop.nix
+++ b/hosts/hardware-configuration-desktop.nix
@@ -9,7 +9,7 @@
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
- boot.initrd.kernelModules = [ ];
+ boot.initrd.kernelModules = [ "amdgpu" ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
@@ -36,4 +36,10 @@
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+
+ hardware.opengl = { enable = true; };
+ services.xserver.videoDrivers = [ "amdgpu" ];
+ # environment.variables = {
+ # AMD_VULKAN_ICD = "RADV"; # Force Mesa RADV over AMDVLK for better perf
+ # };
}
diff --git a/modules/gaming.nix b/modules/gaming.nix
index 9d25b76..15cdc76 100644
--- a/modules/gaming.nix
+++ b/modules/gaming.nix
@@ -1,4 +1,4 @@
-{ pkgs, lib, config, ... }: {
+{ pkgs, pkgs-mesa-pin, lib, config, ... }: {
options.gaming.enable = lib.mkOption {
type = lib.types.bool;
@@ -35,6 +35,8 @@
osu-lazer-bin
lutris
+ ] ++ [
+ pkgs-mesa-pin.mesa
];
};