reorganize hardware
This commit is contained in:
parent
0d9381864c
commit
30baa4ce8b
8 changed files with 67 additions and 55 deletions
|
|
@ -46,15 +46,6 @@
|
||||||
# security
|
# security
|
||||||
security.useDoas = true;
|
security.useDoas = true;
|
||||||
};
|
};
|
||||||
hardware = {
|
|
||||||
audio.enable = true;
|
|
||||||
bluetooth.enable = true;
|
|
||||||
print.enable = true;
|
|
||||||
pointer.enable = true;
|
|
||||||
tablet.enable = true;
|
|
||||||
networking.enable = true;
|
|
||||||
rgb.enable = true;
|
|
||||||
};
|
|
||||||
desktop = {
|
desktop = {
|
||||||
# set to `x11` or `wayland`, improves compat
|
# set to `x11` or `wayland`, improves compat
|
||||||
envProto = "wayland";
|
envProto = "wayland";
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,17 @@
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
# radv > amdvlk
|
modules.hardware = {
|
||||||
environment.variables.AMD_VULKAN_ICD = "RADV";
|
graphics.amdgpu.enable = true;
|
||||||
|
graphics.amdgpu.overclock = true;
|
||||||
environment.systemPackages = with pkgs; [ amdgpu_top ];
|
audio.enable = true;
|
||||||
|
bluetooth.enable = true;
|
||||||
|
networking.enable = true;
|
||||||
|
print.enable = true;
|
||||||
|
pointer.enable = true;
|
||||||
|
rgb.enable = true;
|
||||||
|
tablet.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" =
|
||||||
{ device = "/dev/disk/by-uuid/5da6bab0-856a-4e65-8ff6-5b70fe3764b8";
|
{ device = "/dev/disk/by-uuid/5da6bab0-856a-4e65-8ff6-5b70fe3764b8";
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,6 @@
|
||||||
always_full_speed = false;
|
always_full_speed = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# better performance than the actual intel driver
|
|
||||||
services.xserver.videoDrivers = [ "modesetting" ];
|
|
||||||
|
|
||||||
# replace basic t2 kernel with cachyos kernel
|
# replace basic t2 kernel with cachyos kernel
|
||||||
# same patches and i trust it to be more up to date (one time the "latest" was EOL for t2,,,)
|
# same patches and i trust it to be more up to date (one time the "latest" was EOL for t2,,,)
|
||||||
# also interesting how this supports l4 but my big computer doesn't...
|
# also interesting how this supports l4 but my big computer doesn't...
|
||||||
|
|
@ -30,19 +27,6 @@
|
||||||
# fix wifi firmware
|
# fix wifi firmware
|
||||||
hardware.apple-t2.firmware.enable = true;
|
hardware.apple-t2.firmware.enable = true;
|
||||||
|
|
||||||
environment.variables = {
|
|
||||||
LIBVA_DRIVER_NAME= "iHD";
|
|
||||||
VDPAU_DRIVER = "va_gl";
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [ intel-gpu-tools ];
|
|
||||||
|
|
||||||
boot.kernelParams = [
|
|
||||||
# enable the i915 sandybridge framebuffer compression (475mw savings)
|
|
||||||
"i915.enable_fbc=1"
|
|
||||||
"i915.enable_gvt=1"
|
|
||||||
];
|
|
||||||
|
|
||||||
# fix sleep/suspend
|
# fix sleep/suspend
|
||||||
# ty https://github.com/3ulalia/flake/blob/aaddbef19979c6d952f7a763cd9e6225d6330a02/hosts/catalina/default.nix
|
# ty https://github.com/3ulalia/flake/blob/aaddbef19979c6d952f7a763cd9e6225d6330a02/hosts/catalina/default.nix
|
||||||
systemd.services."suspend-fix-t2" = {
|
systemd.services."suspend-fix-t2" = {
|
||||||
|
|
|
||||||
|
|
@ -38,13 +38,6 @@
|
||||||
# security
|
# security
|
||||||
security.useDoas = true;
|
security.useDoas = true;
|
||||||
};
|
};
|
||||||
hardware = {
|
|
||||||
audio.enable = true;
|
|
||||||
bluetooth.enable = true;
|
|
||||||
print.enable = true;
|
|
||||||
pointer.enable = true;
|
|
||||||
networking.enable = true;
|
|
||||||
};
|
|
||||||
desktop = {
|
desktop = {
|
||||||
# set to `x11` or `wayland`, improves compat
|
# set to `x11` or `wayland`, improves compat
|
||||||
envProto = "wayland";
|
envProto = "wayland";
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@
|
||||||
imports =
|
imports =
|
||||||
[
|
[
|
||||||
inputs.hardware.nixosModules.apple-t2
|
inputs.hardware.nixosModules.apple-t2
|
||||||
inputs.hardware.nixosModules.common-cpu-intel
|
(inputs.hardware + "/common/cpu/intel/ice-lake")
|
||||||
|
(inputs.hardware + "/common/gpu/intel/ice-lake")
|
||||||
inputs.hardware.nixosModules.common-pc-laptop-ssd
|
inputs.hardware.nixosModules.common-pc-laptop-ssd
|
||||||
inputs.hardware.nixosModules.common-pc-laptop
|
inputs.hardware.nixosModules.common-pc-laptop
|
||||||
|
|
||||||
|
|
@ -21,6 +22,14 @@
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
modules.hardware = {
|
||||||
|
graphics.i915.enable = true;
|
||||||
|
audio.enable = true;
|
||||||
|
bluetooth.enable = true;
|
||||||
|
networking.enable = true;
|
||||||
|
pointer.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" =
|
||||||
{ device = "/dev/disk/by-uuid/0f09afdc-88e4-4764-818b-77828931278f";
|
{ device = "/dev/disk/by-uuid/0f09afdc-88e4-4764-818b-77828931278f";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
|
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
{ lib, config, ... }:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
let
|
|
||||||
cfg = config.modules.dev;
|
|
||||||
in {
|
|
||||||
options.modules.dev = {
|
|
||||||
enable = mkEnableOption "General development utilities";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
programs.direnv = {
|
|
||||||
enable = true;
|
|
||||||
silent = true;
|
|
||||||
nix-direnv.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
22
modules/hardware/graphics/amdgpu.nix
Normal file
22
modules/hardware/graphics/amdgpu.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
{ pkgs, config, lib, inputs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.hardware.graphics.amdgpu;
|
||||||
|
in {
|
||||||
|
options.modules.hardware.graphics.amdgpu = {
|
||||||
|
enable = mkEnableOption "Enable AMD graphics drivers, used in conjuction with nixos-hardware";
|
||||||
|
overclock = mkEnableOption "Enable overclocking on AMD graphics drivers";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
hardware.amdgpu.opencl.enable = true;
|
||||||
|
hardware.amdgpu.overdrive.enable = cfg.overclock;
|
||||||
|
services.lact.enable = cfg.overclock;
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [ amdgpu_top ];
|
||||||
|
|
||||||
|
# radv > amdvlk
|
||||||
|
environment.variables.AMD_VULKAN_ICD = "RADV";
|
||||||
|
};
|
||||||
|
}
|
||||||
24
modules/hardware/graphics/i915.nix
Normal file
24
modules/hardware/graphics/i915.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
{ pkgs, config, lib, inputs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.modules.hardware.graphics.i915;
|
||||||
|
in {
|
||||||
|
options.modules.hardware.graphics.i915 = {
|
||||||
|
enable = mkEnableOption "Enable Intel i915 graphics drivers, used in conjuction with nixos-hardware";
|
||||||
|
powersave = mkEnableOption {
|
||||||
|
default = config.modules.core.laptop;
|
||||||
|
description = "Enable intel i915-specific powersaving tweaks";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
environment.systemPackages = with pkgs; [ intel-gpu-tools ];
|
||||||
|
hardware.intel-gpu-tools.enable = true;
|
||||||
|
|
||||||
|
boot.kernelParams = [
|
||||||
|
# enable gpu virtualization
|
||||||
|
"i915.enable_gvt=1"
|
||||||
|
] ++ optional cfg.powersave "i915.enable_fbc=1";
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue