summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-08-28 13:01:00 +0530
committersinanmohd <sinan@sinanmohd.com>2024-08-28 13:02:55 +0530
commit37da6d768b52dbff17c3b9d23d26237054fa55c8 (patch)
treedd887e0b50a496e41264d33374d017af82168ac8 /os
parent3fad7111c3dc939356a81dfc88ca4198d82640e5 (diff)
cez/specialisation: move to standalone module
Diffstat (limited to 'os')
-rw-r--r--os/cez/configuration.nix1
-rw-r--r--os/cez/hardware-configuration.nix30
-rw-r--r--os/cez/modules/specialisation.nix28
3 files changed, 30 insertions, 29 deletions
diff --git a/os/cez/configuration.nix b/os/cez/configuration.nix
index b39f6e6..59ea6b6 100644
--- a/os/cez/configuration.nix
+++ b/os/cez/configuration.nix
@@ -3,6 +3,7 @@
../pc/configuration.nix
./hardware-configuration.nix
+ ./modules/specialisation.nix
./modules/wireguard.nix
./modules/tlp.nix
];
diff --git a/os/cez/hardware-configuration.nix b/os/cez/hardware-configuration.nix
index 5d1a24c..056f65a 100644
--- a/os/cez/hardware-configuration.nix
+++ b/os/cez/hardware-configuration.nix
@@ -1,4 +1,4 @@
-{ modulesPath, nixos-hardware, config, lib, ... }:
+{ modulesPath, nixos-hardware, config, ... }:
{
imports = [
@@ -11,39 +11,11 @@
hardware.amdgpu.initrd.enable = false;
services.xserver.videoDrivers = [ "modesetting" ];
- specialisation.nvidia.configuration = {
- boot = {
- kernelParams = [ "transparent_hugepage=always" ];
- kernel.sysctl."vm.max_map_count" = 2147483642;
- };
-
- environment.variables = {
- DRI_PRIME = 1;
- __NV_PRIME_RENDER_OFFLOAD = 1;
- __VK_LAYER_NV_optimus = "NVIDIA_only";
- __GLX_VENDOR_LIBRARY_NAME = "nvidia";
- };
-
- hardware.nvidia = {
- open = true;
- nvidiaSettings = false;
- prime.sync.enable = true;
- };
-
- services = {
- xserver.videoDrivers = [ "nvidia" ];
- tlp.settings.PLATFORM_PROFILE_ON_AC = lib.mkForce "performance";
- };
- nixpkgs.config.allowUnfreePredicate =
- pkg: builtins.elem (lib.getName pkg) [ "nvidia-x11" ];
- };
-
boot = {
loader.systemd-boot.enable = true;
blacklistedKernelModules = [ "k10temp" ];
extraModulePackages = with config.boot.kernelPackages; [ zenpower ];
-
initrd = {
systemd.enable = true;
luks.devices."crypt".device =
diff --git a/os/cez/modules/specialisation.nix b/os/cez/modules/specialisation.nix
new file mode 100644
index 0000000..ccee839
--- /dev/null
+++ b/os/cez/modules/specialisation.nix
@@ -0,0 +1,28 @@
+{ lib, ... }: {
+ specialisation.nvidia.configuration = {
+ boot = {
+ kernelParams = [ "transparent_hugepage=always" ];
+ kernel.sysctl."vm.max_map_count" = 2147483642;
+ };
+
+ environment.variables = {
+ DRI_PRIME = 1;
+ __NV_PRIME_RENDER_OFFLOAD = 1;
+ __VK_LAYER_NV_optimus = "NVIDIA_only";
+ __GLX_VENDOR_LIBRARY_NAME = "nvidia";
+ };
+
+ hardware.nvidia = {
+ open = true;
+ nvidiaSettings = false;
+ prime.sync.enable = true;
+ };
+
+ services = {
+ xserver.videoDrivers = [ "nvidia" ];
+ tlp.settings.PLATFORM_PROFILE_ON_AC = lib.mkForce "performance";
+ };
+ nixpkgs.config.allowUnfreePredicate =
+ pkg: builtins.elem (lib.getName pkg) [ "nvidia-x11" ];
+ };
+}