diff --git a/home/Aloria.nix b/home/Aloria.nix index 83877af..132b89d 100644 --- a/home/Aloria.nix +++ b/home/Aloria.nix @@ -23,7 +23,7 @@ }; # wayland.windowManager.hyprland.settings.env = ["WLR_DRM_DEVICES,/dev/dri/by-path/pci-0000:01:00.0-card"]; # Nvidia - # wayland.windowManager.hyprland.settings.env = ["WLR_DRM_DEVICES,/dev/dri/by-path/pci-0000:00:02.0-card"]; # Intel + wayland.windowManager.hyprland.settings.env = ["WLR_DRM_DEVICES,/dev/dri/by-path/pci-0000:00:02.0-card"]; # Intel wayland.windowManager.hyprland.settings = { exec-once = [ "${pkgs.swaylock-fancy}/bin/swaylock-fancy" diff --git a/hosts/Aloria/default.nix b/hosts/Aloria/default.nix index 5e1f061..39d9bbc 100644 --- a/hosts/Aloria/default.nix +++ b/hosts/Aloria/default.nix @@ -8,24 +8,55 @@ in { (import ../Common/desktop.nix { inherit inputs pkgs config; }) (import ../Common/nfs.nix { inherit pkgs serverIP; }) ]; + + programs.nix-ld.enable = true; hardware.graphics.extraPackages = [ pkgs.intel-compute-runtime pkgs.intel-media-driver ]; zramSwap.enable = true; + services.upower.enable = true; services.logind.extraConfig = ''HandlePowerKey=ignore''; - # services.ollama = { - # enable = true; - # }; - programs.nix-ld.enable = true; + networking.wireless.iwd.enable = true; + networking.wireless.iwd.settings = { + IPv6 = { + Enabled = true; + }; + Settings = { + AutoConnect = true; + }; + }; + + # virtualisation virtualisation.libvirtd.enable = true; virtualisation.libvirtd.qemu.ovmf.enable = true; virtualisation.spiceUSBRedirection.enable = true; programs.virt-manager.enable = true; users.users.user.extraGroups = [ "libvirtd" ]; + services.tlp = { + enable = true; + settings = { + CPU_SCALING_GOVERNOR_ON_AC = "performance"; + CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; + + CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; + CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; + + CPU_MIN_PERF_ON_AC = 0; + CPU_MAX_PERF_ON_AC = 100; + CPU_MIN_PERF_ON_BAT = 0; + CPU_MAX_PERF_ON_BAT = 20; + + #Optional helps save long term battery health + START_CHARGE_THRESH_BAT0 = 40; # 40 and bellow it starts to charge + STOP_CHARGE_THRESH_BAT0 = 80; # 80 and above it stops charging + + }; + }; + networking.wg-quick.interfaces = { Tunnel = { address = [ "10.0.0.5/24" "2a02:a03f:83ad:2101::5/128" ]; @@ -56,16 +87,4 @@ in { }]; }; }; - # fileSystems."/home/server".device = pkgs.lib.mkForce "10.0.0.1:/home/server"; - - services.upower.enable = true; - networking.wireless.iwd.enable = true; - networking.wireless.iwd.settings = { - IPv6 = { - Enabled = true; - }; - Settings = { - AutoConnect = true; - }; - }; } diff --git a/hosts/Common/default.nix b/hosts/Common/default.nix index 989114e..9929d21 100644 --- a/hosts/Common/default.nix +++ b/hosts/Common/default.nix @@ -14,6 +14,7 @@ boot.kernelPackages = pkgs.linuxPackages_latest; boot.tmp.cleanOnBoot = true; + powerManagement.enable = true; services.thermald.enable = true; services.pcscd.enable = true; services.fwupd.enable = true; diff --git a/hosts/Common/desktop.nix b/hosts/Common/desktop.nix index 875a4b3..033f1a3 100644 --- a/hosts/Common/desktop.nix +++ b/hosts/Common/desktop.nix @@ -5,7 +5,6 @@ hardware.graphics = { enable = true; }; - services.power-profiles-daemon.enable = true; services.greetd = { enable = true; diff --git a/hosts/Common/nvidia.nix b/hosts/Common/nvidia.nix index 112ca99..a4140b5 100644 --- a/hosts/Common/nvidia.nix +++ b/hosts/Common/nvidia.nix @@ -43,5 +43,33 @@ prime.sync.enable = pkgs.lib.mkForce true; }; }; + disable.configuration = { + system.nixos.tags = [ "disable" ]; + hardware.nvidia = { + modesetting.enable = pkgs.lib.mkForce false; + powerManagement.enable = pkgs.lib.mkForce false; + powerManagement.finegrained = pkgs.lib.mkForce false; + open = pkgs.lib.mkForce false; + nvidiaSettings = pkgs.lib.mkForce false; + prime.offload.enable = pkgs.lib.mkForce false; + prime.offload.enableOffloadCmd = pkgs.lib.mkForce false; + }; + boot.extraModprobeConfig = '' + blacklist nouveau + options nouveau modeset=0 + ''; + + services.udev.extraRules = '' + # Remove NVIDIA USB xHCI Host Controller devices, if present + ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{power/control}="auto", ATTR{remove}="1" + # Remove NVIDIA USB Type-C UCSI devices, if present + ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{power/control}="auto", ATTR{remove}="1" + # Remove NVIDIA Audio devices, if present + ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{power/control}="auto", ATTR{remove}="1" + # Remove NVIDIA VGA/3D controller devices + ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", ATTR{power/control}="auto", ATTR{remove}="1" + ''; + boot.blacklistedKernelModules = [ "nouveau" "nvidia" "nvidia_drm" "nvidia_modeset" ]; + }; }; }