summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
Diffstat (limited to 'os')
-rw-r--r--os/cez/configuration.nix1
-rw-r--r--os/cez/hardware-configuration.nix25
-rw-r--r--os/cez/modules/specialisation/default.nix6
-rw-r--r--os/cez/modules/specialisation/heater.nix31
-rw-r--r--os/cez/modules/specialisation/nvidia.nix25
-rw-r--r--os/common/modules/home-manager.nix13
6 files changed, 68 insertions, 33 deletions
diff --git a/os/cez/configuration.nix b/os/cez/configuration.nix
index 90c7786..0cf9957 100644
--- a/os/cez/configuration.nix
+++ b/os/cez/configuration.nix
@@ -7,6 +7,7 @@
./modules/wireguard.nix
./modules/tlp.nix
../../global/cez
+ ./modules/specialisation
];
networking.hostName = "cez";
diff --git a/os/cez/hardware-configuration.nix b/os/cez/hardware-configuration.nix
index 39dc3a6..da9ed90 100644
--- a/os/cez/hardware-configuration.nix
+++ b/os/cez/hardware-configuration.nix
@@ -46,29 +46,4 @@
fsType = "ext4";
};
};
-
- 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";
- };
- };
}
diff --git a/os/cez/modules/specialisation/default.nix b/os/cez/modules/specialisation/default.nix
new file mode 100644
index 0000000..c7fb4aa
--- /dev/null
+++ b/os/cez/modules/specialisation/default.nix
@@ -0,0 +1,6 @@
+{
+ specialisation = {
+ nvidia.configuration.imports = [ ./nvidia.nix ];
+ heater.configuration.imports = [ ./heater.nix ];
+ };
+}
diff --git a/os/cez/modules/specialisation/heater.nix b/os/cez/modules/specialisation/heater.nix
new file mode 100644
index 0000000..68dbf4d
--- /dev/null
+++ b/os/cez/modules/specialisation/heater.nix
@@ -0,0 +1,31 @@
+{
+ config,
+ pkgs,
+ lib,
+ ...
+}:
+let
+ heater = pkgs.writeShellApplication {
+ name = "heater";
+ runtimeInputs = with pkgs; [
+ vulkan-tools
+ mangohud
+ ];
+
+ text = ''
+ MESA_VK_WSI_PRESENT_MODE=immediate mangohud vkcube --present_mode 0
+ '';
+ };
+ username = config.global.userdata.name;
+in
+{
+ imports = [ ./nvidia.nix ];
+
+ services.logind.settings.Login.HandleLidSwitch = "ignore";
+ environment.systemPackages = [ heater ];
+ home-manager.users.${username}.imports = [
+ {
+ wayland.windowManager.sway.settings.exec = [ "${lib.getExe heater}" ];
+ }
+ ];
+}
diff --git a/os/cez/modules/specialisation/nvidia.nix b/os/cez/modules/specialisation/nvidia.nix
new file mode 100644
index 0000000..3ac30b4
--- /dev/null
+++ b/os/cez/modules/specialisation/nvidia.nix
@@ -0,0 +1,25 @@
+{ lib, ... }:
+{
+ 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";
+ };
+}
diff --git a/os/common/modules/home-manager.nix b/os/common/modules/home-manager.nix
index 8212747..722c9ab 100644
--- a/os/common/modules/home-manager.nix
+++ b/os/common/modules/home-manager.nix
@@ -2,18 +2,15 @@
let
username = config.global.userdata.name;
host = config.networking.hostName;
+ homeManagerHostPath = ../../../home/${host}/home.nix;
in
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = false;
- users.${username} =
- { ... }:
- {
- imports = [
- ../../../home/common/home.nix
- ]
- ++ lib.optional (builtins.pathExists ../../../home/${host}) ../../../home/${host}/home.nix;
- };
+ users.${username}.imports = [
+ ../../../home/common/home.nix
+ ]
+ ++ lib.optional (builtins.pathExists homeManagerHostPath) homeManagerHostPath;
};
}