all repos — dotfiles @ ba95ec38a62cb8b99188e5b644144d86c27cf6a3

my *nix dotfiles

nix/wyndle: completely power off nvidia gpu
Anirudh Oppiliappan x@icyphox.sh
Fri, 09 Aug 2024 12:37:13 +0300
commit

ba95ec38a62cb8b99188e5b644144d86c27cf6a3

parent

37746ec6d7e38e614d0d1d777d0d20aed64624db

5 files changed, 59 insertions(+), 17 deletions(-)

jump to
M home.nixhome.nix

@@ -55,14 +55,15 @@ evolution

nix-your-shell pass newsflash + errands wl-clipboard zed-editor + nvtop gnome3.gnome-tweaks gnome3.gnome-shell-extensions gnomeExtensions.appindicator gnomeExtensions.dash-to-dock - gnomeExtensions.unite gnomeExtensions.search-light gnomeExtensions.hide-top-bar

@@ -77,6 +78,16 @@ show-all-sources = true;

sources = [ (mkTuple [ "xkb" "us+workman" ]) (mkTuple [ "xkb" "us" ]) ]; xkb-options = [ "terminate:ctrl_alt_bksp" "compose:ralt" ]; }; + "org/gnome/mutter" = { + overlay-key = [ "" ]; + }; + "org/gnome/shell/extensions/search-light" = { + shortcut-search = [ "<Super>space" ]; + }; + "org/gnome/settings-daemon/plugins/media-keys" = { + screensaver = [ "<Control><Super>q" ]; + }; + }; xdg = {

@@ -92,3 +103,4 @@ };

} +
A hosts/wyndle/ca.crt

@@ -0,0 +1,10 @@

+-----BEGIN CERTIFICATE----- +MIIBYzCCAQqgAwIBAgIQQXPE95edZ9tbVlE3U9swSTAKBggqhkjOPQQDAjASMRAw +DgYDVQQDEwdrb3RpLWNhMB4XDTI0MDYzMDEyNTQ1MloXDTI0MDkyODEyNTQ1Mlow +EjEQMA4GA1UEAxMHa290aS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABPw/ +8P40i9kcD2nmWFxINc65nZLFGmArSXmFnYzEq2o+M3Ej1rkJwktMZxXVpX5LnKkb +RGsIDounU+1gZ2RH4XOjQjBAMA4GA1UdDwEB/wQEAwICpDAPBgNVHRMBAf8EBTAD +AQH/MB0GA1UdDgQWBBSemP2OBfiqaSzd1AzAxOY8H5z31DAKBggqhkjOPQQDAgNH +ADBEAiAm+fQIYzPjoUmIYNzL9iuYzvnBtvrT9jFXsSInfmetWgIgfpDTaIfZ/bQp +vQ9FmFTvqDBSOdVosQ7EweC4uu9bZkg= +-----END CERTIFICATE-----
M hosts/wyndle/configuration.nixhosts/wyndle/configuration.nix

@@ -16,6 +16,12 @@ kernelPackages = pkgs.linuxPackages_latest;

kernelModules = [ "i2c-dev" ]; }; + boot.blacklistedKernelModules = [ "nouveau" "nvidia" "nvidia_drm" "nvidia_modeset" ]; + boot.extraModprobeConfig = '' + blacklist nouveau + options nouveau modeset=0 + ''; + networking = { nameservers = [ "8.8.8.8" "8.8.4.4" ]; networkmanager.enable = true;

@@ -59,19 +65,6 @@ customPkgs

]; environment = { - etc = { - "supergfxd.conf" = { - mode = "0644"; - source = (pkgs.formats.json { }).generate "supergfxd.conf" { - mode = "hybrid"; - vfio_enable = false; - vfio_save = false; - always_reboot = false; - no_logind = false; - logout_timeout_s = 180; - }; - }; - }; sessionVariables = rec { NIXOS_OZONE_WL = "1"; };

@@ -121,7 +114,7 @@ powerOnBoot = true;

disabledPlugins = [ "sap" ]; }; nvidia.prime = { - offload.enable = true; + offload.enable = false; amdgpuBusId = "PCI:8:0:0"; nvidiaBusId = "PCI:1:0:0"; };

@@ -138,6 +131,15 @@ enableUserService = true;

}; supergfxd = { enable = true; + settings = { + mode = "integrated"; + vfio_enable = false; + vfio_save = false; + always_reboot = true; + no_logind = false; + logout_timeout_s = 180; + }; + }; pipewire = { enable = true;

@@ -152,7 +154,7 @@ xkb.layout = "us";

desktopManager.gnome.enable = true; displayManager.gdm.enable = true; dpi = 192; - videoDrivers = [ "nvidia" ]; + videoDrivers = [ "amdgpu" ]; screenSection = '' Option "metamodes" "nvidia-auto-select +0+0 {ForceFullCompositionPipeline=On}" Option "AllowIndirectGLXProtocol" "off"

@@ -177,6 +179,15 @@ extraRules = ''

ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="amdgpu_bl1", MODE="0666", RUN+="${pkgs.coreutils}/bin/chmod a+w /sys/class/backlight/%k/brightness" ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0036", TAG+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" KERNEL=="i2c-[0-9]*", GROUP="i2c", MODE="0660" + + # 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" ''; extraHwdb = '' evdev:input:b0003v0B05p19B6*

@@ -251,6 +262,7 @@ '';

doas.extraRules = [{ users = [ "icy" ]; }]; + pki.certificateFiles = [ ./ca.crt ]; }; powerManagement = {
M nvim/lua/dapx.luanvim/lua/dapx.lua

@@ -29,6 +29,14 @@ name = "Debug (main.go)",

request = "launch", program = "${workspaceFolderBasename}/cmd/main.go", }, + { + type = "go", + name = "Debug (Build Flags & Arguments)", + request = "launch", + program = "${file}", + args = require("dap-go").get_arguments, + buildFlags = require("dap-go").get_build_flags, + }, }, }
M programs/alacritty.nixprograms/alacritty.nix

@@ -33,7 +33,7 @@ window = {

padding.x = 10; padding.y = 10; dynamic_padding = true; - decorations = "None"; + decorations = "Full"; startup_mode = "Maximized";