From 1e99e723c598fface4bedffe60220d2c424bcae9 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sat, 4 Feb 2023 14:17:17 +0530 Subject: enable i915 --- home.nix | 4 ++- hosts/myrtle/configuration.nix | 63 +++++++++++++++++++++++++++++++++--------- scripts/default.nix | 8 +++--- 3 files changed, 57 insertions(+), 18 deletions(-) diff --git a/home.nix b/home.nix index 16cc9dd..7c9ae93 100644 --- a/home.nix +++ b/home.nix @@ -69,6 +69,8 @@ # monitoring s-tui + nvtop + lshw stress powertop @@ -84,6 +86,7 @@ # work slack zoom-us + ] ++ (import ./scripts { inherit pkgs; }); xdg = { @@ -103,7 +106,6 @@ windowManager.command = "2bwm"; initExtra = '' ${pkgs.hsetroot}/bin/hsetroot -solid "${theme.base00}" - xrandr --dpi 192 xrdb -load $HOME/.Xresources ''; }; diff --git a/hosts/myrtle/configuration.nix b/hosts/myrtle/configuration.nix index db70416..74f4861 100644 --- a/hosts/myrtle/configuration.nix +++ b/hosts/myrtle/configuration.nix @@ -12,7 +12,7 @@ boot.kernelPackages = pkgs.linuxPackages_latest; boot.blacklistedKernelModules = [ "nouveau" ]; boot.kernelParams = [ - "module_blacklist=i915" + "i915.modeset=0" # "intel_pstate=disable" ]; @@ -54,18 +54,23 @@ vim-colors-plain ]; - environment.systemPackages = with pkgs; [ - _2bwm - man-pages - man-pages-posix - (lib.hiPrio pkgs.bashInteractive_5) + environment = { + variables = { + MOZ_USE_XINPUT2 = "1"; + }; + systemPackages = with pkgs; [ + _2bwm + man-pages + man-pages-posix + (lib.hiPrio pkgs.bashInteractive_5) - # turbo - config.boot.kernelPackages.turbostat - config.boot.kernelPackages.nvidia_x11 + # turbo + config.boot.kernelPackages.turbostat + config.boot.kernelPackages.nvidia_x11 - xdotool - ]; + xdotool + ]; + }; documentation = { @@ -86,7 +91,9 @@ }; sound.enable = true; + hardware = { + opengl.driSupport = true; pulseaudio = { enable = true; package = pkgs.pulseaudioFull; @@ -96,19 +103,46 @@ enable = true; powerOnBoot = true; }; - nvidia.package = config.boot.kernelPackages.nvidiaPackages.latest; + nvidia = { + prime = { + offload.enable = true; + intelBusId = "PCI:00:02:0"; + nvidiaBusId = "PCI:01:00:0"; + }; + package = config.boot.kernelPackages.nvidiaPackages.latest; + powerManagement = { + enable = true; + finegrained = true; + }; + }; }; + powerManagement = { + enable = true; + powertop.enable = true; + }; services = { xserver = { enable = true; layout = "us"; - videoDrivers = [ "nvidia" ]; + videoDrivers = [ "nvidia" "intel" ]; displayManager.startx.enable = true; + dpi = 192; libinput.enable = true; + serverLayoutSection = '' + Screen "Screen-nvidia[0]" + ''; + config = lib.mkAfter '' + Section "Screen" + Identifier "Screen-nvidia[0]" + Device "Device-nvidia[0]" + EndSection + ''; }; + openssh.enable = true; + asusd = { enable = true; enableUserService = true; @@ -138,6 +172,9 @@ isNormalUser = true; home = "/home/np"; extraGroups = [ "wheel" "users" "tty" "audio" "video" "input" "adbusers" "docker" ]; + openssh.authorizedKeys.keys = [ + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCrmh1vEWwKm8gpOk9j3DkZsiJCojpBdxuWU4M8rFeV/U9isRB+3pSJvF3Sncc6Yd+hSDohpzQF/Q5urubjkrGDniAKFjZnUHWZEzJmfQLHLIHXBkHjY8UMYF/WZprcplBKAZ7S9tS0YGa6NOQe2KEFtNG6XtBnrI3lswAHPOlqKJBG47MxfjIi9aUhczlzPxtGC9AfdwaNQYgLoJ91I6jkKuyKjbYt8KDDL+6PJ63TZc18LKKct1rf+ejRJKR9+jHTkEXhltUSQkieOJiEOdVcYWbYBxSoWutrnrksnhi9dLABOvueG6mAORU5g1yrMnX80RbK8DauwG4WI9qIGvHNPpQqP0vjj4mr8YkOUmzyeTW3KlOsQJZ7279WruBYV96/a7YoHKj9fGzV4McvVpvLMYa47hqyCBRK/qz0BSLFEhSNZzqseXCk91qZ0EhROBQEckqlKVip75YWFhqjVrgSPnVYWHxceNMttKmfGgIGXI8Bc8TKRZd+7quJNG7cWIE= np@olive" + ]; }; nix = { diff --git a/scripts/default.nix b/scripts/default.nix index 627b121..b4ee23a 100644 --- a/scripts/default.nix +++ b/scripts/default.nix @@ -55,13 +55,13 @@ let landscape-transform = builtins.toString [ 0 0 0 0 0 0 0 0 0 ]; portrait = pkgs.writeScriptBin "portrait" '' ${pkgs.xorg.xrandr}/bin/xrandr -o left - ${pkgs.xorg.xinput}/bin/xinput set-prop ${touchscreen} --type=float "Coordinate Transformation Matrix" ${portait-transform} - ${pkgs.xorg.xinput}/bin/xinput set-prop ${stylus} --type=float "Coordinate Transformation Matrix" ${portait-transform} + ${pkgs.xorg.xinput}/bin/xinput set-prop "${touchscreen}" --type=float "Coordinate Transformation Matrix" ${portait-transform} + ${pkgs.xorg.xinput}/bin/xinput set-prop "${stylus}" --type=float "Coordinate Transformation Matrix" ${portait-transform} ''; landscape = pkgs.writeScriptBin "landscape" '' ${pkgs.xorg.xrandr}/bin/xrandr -o normal - ${pkgs.xorg.xinput}/bin/xinput set-prop ${touchscreen} --type=float "Coordinate Transformation Matrix" ${landscape-transform} - ${pkgs.xorg.xinput}/bin/xinput set-prop ${stylus} --type=float "Coordinate Transformation Matrix" ${landscape-transform} + ${pkgs.xorg.xinput}/bin/xinput set-prop "${touchscreen}" --type=float "Coordinate Transformation Matrix" ${landscape-transform} + ${pkgs.xorg.xinput}/bin/xinput set-prop "${stylus}" --type=float "Coordinate Transformation Matrix" ${landscape-transform} ''; in -- cgit v1.2.3