diff options
author | Adrian Kummerlaender | 2022-01-26 16:16:42 +0100 |
---|---|---|
committer | Adrian Kummerlaender | 2022-01-26 16:16:42 +0100 |
commit | c7d90c505aefe8719a79baa04a97d2a7937e389c (patch) | |
tree | 49cf8078ffb11c467056d9140c21a903dcc9cfb6 /host | |
parent | d29a5d690c03b0e50484b4a4793d1c2da1db617c (diff) | |
download | nixos_system-c7d90c505aefe8719a79baa04a97d2a7937e389c.tar nixos_system-c7d90c505aefe8719a79baa04a97d2a7937e389c.tar.gz nixos_system-c7d90c505aefe8719a79baa04a97d2a7937e389c.tar.bz2 nixos_system-c7d90c505aefe8719a79baa04a97d2a7937e389c.tar.lz nixos_system-c7d90c505aefe8719a79baa04a97d2a7937e389c.tar.xz nixos_system-c7d90c505aefe8719a79baa04a97d2a7937e389c.tar.zst nixos_system-c7d90c505aefe8719a79baa04a97d2a7937e389c.zip |
Adapt athena config from X1 to P14s
Diffstat (limited to 'host')
-rw-r--r-- | host/athena.nix | 63 | ||||
-rw-r--r-- | host/hardware/athena.nix | 11 |
2 files changed, 44 insertions, 30 deletions
diff --git a/host/athena.nix b/host/athena.nix index 1371bf9..6426bb9 100644 --- a/host/athena.nix +++ b/host/athena.nix @@ -29,30 +29,30 @@ users.extraUsers.common.extraGroups = [ "networkmanager" "libvirtd" ]; - networking.wireguard.interfaces = { - wg0 = { - ips = [ "10.100.0.4/24" ]; + #networking.wireguard.interfaces = { + # wg0 = { + # ips = [ "10.100.0.4/24" ]; - privateKeyFile = "/etc/wireguard/private"; + # privateKeyFile = "/etc/wireguard/private"; - peers = [ - { # automatix - publicKey = "B0tkjq+5SfECKx1gWEP5JVWOIaRWL2JNE7iSpMmN4F0="; - allowedIPs = [ "10.100.0.0/24" ]; - endpoint = "kummerlaender.eu:54321"; + # peers = [ + # { # automatix + # publicKey = "B0tkjq+5SfECKx1gWEP5JVWOIaRWL2JNE7iSpMmN4F0="; + # allowedIPs = [ "10.100.0.0/24" ]; + # endpoint = "kummerlaender.eu:54321"; - persistentKeepalive = 10; - } - ]; - }; - }; + # persistentKeepalive = 10; + # } + # ]; + # }; + #}; services = { upower.enable = true; acpid.enable = true; xserver = { - videoDrivers = [ "modesetting" ]; + videoDrivers = [ "nvidia" ]; synaptics = { enable = true; @@ -71,6 +71,25 @@ }; }; + hardware.nvidia = { + package = pkgs.linuxPackages.nvidia_x11; + prime = { + offload.enable = true; + + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; + }; + powerManagement.enable = true; + }; + + environment.systemPackages = [ (pkgs.writeScriptBin "nvidia-offload" '' + export __NV_PRIME_RENDER_OFFLOAD=1 + export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 + export __GLX_VENDOR_LIBRARY_NAME=nvidia + export __VK_LAYER_NV_optimus=NVIDIA_only + exec -a "$0" "$@" + '') ]; + virtualisation.libvirtd.enable = true; hardware.trackpoint = { @@ -81,22 +100,18 @@ hardware.bluetooth.enable = true; - hardware.opengl.extraPackages = [ pkgs.intel-ocl ]; - services.tlp = { enable = true; settings = { RESTORE_DEVICE_STATE_ON_STARTUP = 1; + START_CHARGE_THRESH_BAT0 = 75; + STOP_CHARGE_THRESH_BAT0 = 85; + CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; + ENERGY_PERF_POLICY_ON_BAT = "powersave"; }; }; powerManagement.powertop.enable = true; - console = { - earlySetup = true; - font = "ter-132n"; - packages = [ pkgs.terminus_font ]; - }; - - system.stateVersion = "20.09"; + system.stateVersion = "21.11"; } diff --git a/host/hardware/athena.nix b/host/hardware/athena.nix index 4849b6f..508507a 100644 --- a/host/hardware/athena.nix +++ b/host/hardware/athena.nix @@ -8,26 +8,25 @@ [ (modulesPath + "/installer/scan/not-detected.nix") ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ]; + boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" "sdhci_pci" ]; boot.initrd.kernelModules = [ "dm-snapshot" ]; boot.kernelModules = [ "kvm-intel" "fuse" ]; boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/198fbcc1-0b72-4465-891a-5959c6bfcfc6"; + { device = "/dev/disk/by-uuid/3af135f5-9bfe-4ab4-abb3-2e93caad08ea"; fsType = "ext4"; }; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/6510-C4DF"; + { device = "/dev/disk/by-uuid/6290-9BB5"; fsType = "vfat"; }; swapDevices = - [ { device = "/dev/disk/by-uuid/60bd356a-c28e-4f5e-90ff-6331a3cb7252"; } + [ { device = "/dev/disk/by-uuid/b3845af4-030a-4bba-bad8-89c548bde40f"; } ]; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; - # high-resolution display - hardware.video.hidpi.enable = lib.mkDefault true; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; } |