summaryrefslogtreecommitdiff
path: root/modules/hardware
diff options
context:
space:
mode:
authorMel <mel@rnrd.eu>2026-01-06 18:41:15 +0100
committerMel <mel@rnrd.eu>2026-01-06 18:41:15 +0100
commitee5f89c69f60fbe2821b9fdf780146fbec73725c (patch)
treef8079c0b1b972ddaed92937d89a3b95f65c8698d /modules/hardware
parent1c0969c93bbc18d4327bc213fa82df659e6bd61c (diff)
downloadminerals-ee5f89c69f60fbe2821b9fdf780146fbec73725c.tar.zst
minerals-ee5f89c69f60fbe2821b9fdf780146fbec73725c.zip
Switch Bismuth from Nvidia to AMD, move hardware modules to own directory
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'modules/hardware')
-rw-r--r--modules/hardware/amd-gpu.nix31
-rw-r--r--modules/hardware/arm.nix23
-rw-r--r--modules/hardware/nvidia-gpu.nix49
3 files changed, 103 insertions, 0 deletions
diff --git a/modules/hardware/amd-gpu.nix b/modules/hardware/amd-gpu.nix
new file mode 100644
index 0000000..cfaa974
--- /dev/null
+++ b/modules/hardware/amd-gpu.nix
@@ -0,0 +1,31 @@
+{
+ pkgs,
+ ...
+}:
+
+{
+ hardware.graphics = {
+ enable = true;
+ enable32Bit = true;
+
+ # use amdvlk in conjunction with amdgpu,
+ # applications can choose which one to use.
+ extraPackages = with pkgs; [ amdvlk ];
+ extraPackages32 = with pkgs; [ driversi686Linux.amdvlk ];
+ };
+
+ services.xserver.videoDrivers = [ "amdgpu" ];
+
+ hardware.amdgpu = {
+ opencl.enable = true;
+ initrd.enable = true;
+ overdrive.enable = false;
+ legacySupport.enable = false;
+ };
+
+ services.lact.enable = true;
+ environment.systemPackages = with pkgs; [
+ lact
+ clinfo
+ ];
+}
diff --git a/modules/hardware/arm.nix b/modules/hardware/arm.nix
new file mode 100644
index 0000000..63a448f
--- /dev/null
+++ b/modules/hardware/arm.nix
@@ -0,0 +1,23 @@
+{
+ me,
+ lib,
+ auxiliaryPkgs,
+ ...
+}:
+
+assert lib.assertMsg (
+ me.system == "aarch64-linux"
+) "arm module included on non-arm (${me.system}) architecture.";
+{
+ # disable things that just don't work on arm.
+
+ programs.steam.enable = lib.mkForce false;
+
+ # non-machine specific arm package selection.
+ # used to include replacements for necessary programs with no
+ # default support for aarch64. (i.e. discord)
+
+ environment.systemPackages = with auxiliaryPkgs; [
+ equibop # discord
+ ];
+}
diff --git a/modules/hardware/nvidia-gpu.nix b/modules/hardware/nvidia-gpu.nix
new file mode 100644
index 0000000..dae9fb5
--- /dev/null
+++ b/modules/hardware/nvidia-gpu.nix
@@ -0,0 +1,49 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+
+let
+ gpl_symbols_linux_615_patch = pkgs.fetchpatch {
+ url = "https://github.com/CachyOS/kernel-patches/raw/914aea4298e3744beddad09f3d2773d71839b182/6.15/misc/nvidia/0003-Workaround-nv_vm_flags_-calling-GPL-only-code.patch";
+ hash = "sha256-YOTAvONchPPSVDP9eJ9236pAPtxYK5nAePNtm2dlvb4=";
+ stripLen = 1;
+ extraPrefix = "kernel/";
+ };
+in
+{
+ hardware.graphics = {
+ enable = true;
+ enable32Bit = true;
+ };
+
+ services.xserver.videoDrivers = [ "nvidia" ];
+
+ hardware.nvidia = {
+ modesetting.enable = true;
+ powerManagement.enable = true;
+ powerManagement.finegrained = false;
+
+ # note: fails to build after 560
+ nvidiaSettings = false;
+
+ # sadly still very crashy :(
+ open = false;
+
+ # nice way:
+ # package = config.boot.kernelPackages.nvidiaPackages.beta;
+ # manual way:
+ package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
+ version = "575.57.08";
+ sha256_64bit = "sha256-KqcB2sGAp7IKbleMzNkB3tjUTlfWBYDwj50o3R//xvI=";
+ sha256_aarch64 = "sha256-VJ5z5PdAL2YnXuZltuOirl179XKWt0O4JNcT8gUgO98=";
+ openSha256 = "sha256-DOJw73sjhQoy+5R0GHGnUddE6xaXb/z/Ihq3BKBf+lg=";
+ settingsSha256 = "sha256-AIeeDXFEo9VEKCgXnY3QvrW5iWZeIVg4LBCeRtMs5Io=";
+ persistencedSha256 = "sha256-Len7Va4HYp5r3wMpAhL4VsPu5S0JOshPFywbO7vYnGo=";
+
+ patches = [ gpl_symbols_linux_615_patch ];
+ };
+ };
+}