From 18efc15b2a2694dac07f89d33bb1243492358a88 Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 26 Jan 2023 16:13:42 +0100 Subject: l aergia.r: init --- lass/1systems/aergia/physical.nix | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 lass/1systems/aergia/physical.nix (limited to 'lass/1systems/aergia/physical.nix') diff --git a/lass/1systems/aergia/physical.nix b/lass/1systems/aergia/physical.nix new file mode 100644 index 00000000..80020239 --- /dev/null +++ b/lass/1systems/aergia/physical.nix @@ -0,0 +1,40 @@ +{ config, lib, pkgs, modulesPath, ... }: +{ + imports = [ + ./config.nix + (modulesPath + "/installer/scan/not-detected.nix") + ]; + disko.devices = import ./disk.nix; + + networking.hostId = "deadbeef"; + # boot.loader.efi.canTouchEfiVariables = true; + boot.loader.grub = { + enable = true; + device = "/dev/nvme0n1"; + efiSupport = true; + efiInstallAsRemovable = true; + }; + + + # Enables the amd cpu scaling https://www.kernel.org/doc/html/latest/admin-guide/pm/amd-pstate.html + # On recent AMD CPUs this can be more energy efficient. + boot.kernelModules = [ "kvm-amd" ]; + + # hardware.cpu.amd.updateMicrocode = true; + + services.xserver.videoDrivers = [ + "amdgpu" + ]; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod" ]; + + services.logind.lidSwitch = "ignore"; + services.logind.lidSwitchDocked = "ignore"; + + environment.systemPackages = [ + pkgs.ryzenadj + ]; + + # textsize + services.xserver.dpi = 200; +} -- cgit v1.2.3 From 2adf9ebfcc9ba12c75eb812843c4daa32d5f07d4 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 30 Jan 2023 00:27:34 +0100 Subject: l aergia.r: finetune hardware --- lass/1systems/aergia/physical.nix | 40 +++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) (limited to 'lass/1systems/aergia/physical.nix') diff --git a/lass/1systems/aergia/physical.nix b/lass/1systems/aergia/physical.nix index 80020239..df310e57 100644 --- a/lass/1systems/aergia/physical.nix +++ b/lass/1systems/aergia/physical.nix @@ -15,10 +15,20 @@ efiInstallAsRemovable = true; }; + boot.kernelPackages = pkgs.linuxPackages_latest; + + boot.kernelParams = [ + # Enable energy savings during sleep + "mem_sleep_default=deep" + "initcall_blacklist=acpi_cpufreq_init" + + # for ryzenadj -i + "iomem=relaxed" + ]; # Enables the amd cpu scaling https://www.kernel.org/doc/html/latest/admin-guide/pm/amd-pstate.html # On recent AMD CPUs this can be more energy efficient. - boot.kernelModules = [ "kvm-amd" ]; + boot.kernelModules = [ "amd-pstate" "kvm-amd" ]; # hardware.cpu.amd.updateMicrocode = true; @@ -28,13 +38,35 @@ boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod" ]; - services.logind.lidSwitch = "ignore"; - services.logind.lidSwitchDocked = "ignore"; - environment.systemPackages = [ + pkgs.vulkan-tools pkgs.ryzenadj + (pkgs.writers.writeDashBin "set_tdp" '' + set -efux + watt=$1 + value=$(( $watt * 1000 )) + ${pkgs.ryzenadj}/bin/ryzenadj --stapm-limit="$value" --fast-limit="$value" --slow-limit="$value" + '') ]; # textsize services.xserver.dpi = 200; + hardware.video.hidpi.enable = lib.mkDefault true; + + # corectrl + programs.corectrl.enable = true; + users.users.mainUser.extraGroups = [ "corectrl" ]; + + # use newer ryzenadj + nixpkgs.config.packageOverrides = super: { + ryzenadj = super.ryzenadj.overrideAttrs (old: { + version = "unstable-2023-01-15"; + src = pkgs.fetchFromGitHub { + owner = "FlyGoat"; + repo = "RyzenAdj"; + rev = "1052fb52b2c0e23ac4cd868c4e74d4a9510be57c"; # unstable on 2023-01-15 + sha256 = "sha256-/IxkbQ1XrBrBVrsR4EdV6cbrFr1m+lGwz+rYBqxYG1k="; + }; + }); + }; } -- cgit v1.2.3 From 3c528d6a28f9f837db5a029e4e0c05be282a6e08 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 30 Jan 2023 15:53:59 +0100 Subject: l aergia.r: rebind shift + f12 --- lass/1systems/aergia/physical.nix | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lass/1systems/aergia/physical.nix') diff --git a/lass/1systems/aergia/physical.nix b/lass/1systems/aergia/physical.nix index df310e57..c6b657ab 100644 --- a/lass/1systems/aergia/physical.nix +++ b/lass/1systems/aergia/physical.nix @@ -69,4 +69,9 @@ }; }); }; + + # keyboard quirks + services.xserver.displayManager.sessionCommands = '' + xmodmap -e 'keycode 96 = F12 Insert F12 F12' # rebind shift + F12 to shift + insert + ''; } -- cgit v1.2.3 From 0c3a901a1b39369230816d4d26b814ecc22a74e1 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 30 Jan 2023 16:13:28 +0100 Subject: l aergia.r: ignore backbuttons --- lass/1systems/aergia/physical.nix | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lass/1systems/aergia/physical.nix') diff --git a/lass/1systems/aergia/physical.nix b/lass/1systems/aergia/physical.nix index c6b657ab..d6fe26ac 100644 --- a/lass/1systems/aergia/physical.nix +++ b/lass/1systems/aergia/physical.nix @@ -74,4 +74,10 @@ services.xserver.displayManager.sessionCommands = '' xmodmap -e 'keycode 96 = F12 Insert F12 F12' # rebind shift + F12 to shift + insert ''; + services.udev.extraHwdb = /* sh */ '' + # disable back buttons + evdev:input:b0003v2F24p0135* # /dev/input/event2 + KEYBOARD_KEY_70026=reserved + KEYBOARD_KEY_70027=reserved + ''; } -- cgit v1.2.3 From f620d8002e224e3e35cbaaf8405ce861ea4f7537 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 30 Jan 2023 16:13:47 +0100 Subject: l aergia.r: ignore power key --- lass/1systems/aergia/physical.nix | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lass/1systems/aergia/physical.nix') diff --git a/lass/1systems/aergia/physical.nix b/lass/1systems/aergia/physical.nix index d6fe26ac..de5f7540 100644 --- a/lass/1systems/aergia/physical.nix +++ b/lass/1systems/aergia/physical.nix @@ -80,4 +80,7 @@ KEYBOARD_KEY_70026=reserved KEYBOARD_KEY_70027=reserved ''; + + # ignore power key + services.logind.extraConfig = "HandlePowerKey=ignore"; } -- cgit v1.2.3