From f7823d9ad3743e3e1256f61b54e1305613918a04 Mon Sep 17 00:00:00 2001 From: Andreas Schaafsma Date: Mon, 9 Dec 2024 22:25:47 +0100 Subject: [PATCH] stable x11 config --- flake.lock | 12 ++--- .../default.nix | 31 ++++++----- .../drivebystation-nix/configuration.nix | 54 ++++++++++++------- .../hardware/acer-monitor-edid.nix | 2 +- 4 files changed, 60 insertions(+), 39 deletions(-) diff --git a/flake.lock b/flake.lock index cdd41c4..99acb43 100644 --- a/flake.lock +++ b/flake.lock @@ -149,11 +149,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1733558619, - "narHash": "sha256-+hpXjj67bWfr8Z4JP32CPqvoqO5hkTNyRZLA5SB6Zmc=", + "lastModified": 1733621779, + "narHash": "sha256-oeBPiHmg8T/Qsf4qMkUqOrn6/xkJwREGo1jA+4xDssk=", "owner": "lilyinstarlight", "repo": "nixos-cosmic", - "rev": "313f9b0d8cb2ec8bec0f4d5170c3fda41d49f58c", + "rev": "b9ec66ed4e1430061ca044e938bb10f3ab629ba3", "type": "github" }, "original": { @@ -299,11 +299,11 @@ ] }, "locked": { - "lastModified": 1733452419, - "narHash": "sha256-eh2i2GtqdWVOP7yjiWtB8FMUWktCZ4vjo81n6g5mSiE=", + "lastModified": 1733538766, + "narHash": "sha256-FEDfBpM82XGdHDbLDJC4lV+QXSVN1rERt1MqtBGJZds=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "020701e6057992329a7cfafc6e3c5d5658bbcf79", + "rev": "66526479b295ad238843a8a7367d2da7ec102757", "type": "github" }, "original": { diff --git a/modules/nixos/hardware/graphics-nvidia-prime-amd-testing/default.nix b/modules/nixos/hardware/graphics-nvidia-prime-amd-testing/default.nix index d0f8a53..dd05342 100644 --- a/modules/nixos/hardware/graphics-nvidia-prime-amd-testing/default.nix +++ b/modules/nixos/hardware/graphics-nvidia-prime-amd-testing/default.nix @@ -17,9 +17,9 @@ in # Enable NVIDIA driver for X11 and Wayland # without modesetting, x server will be run by nvidia - services.xserver.videoDrivers = [ + services.xserver.videoDrivers = [ "amdgpu" - # "modesetting" + #"modesetting" "nvidia" ]; @@ -29,6 +29,11 @@ in extraPackages = with pkgs; [ nvidia-vaapi-driver ]; }; + hardware.graphics.enable32Bit = true; # For 32 bit applications + + # Enable Switcheroo + services.switcherooControl.enable = true; + # Use Beta Driver Package boot.extraModulePackages = [ config.boot.kernelPackages.nvidia_x11_beta ]; @@ -39,20 +44,19 @@ in # Enable required Kernel Modules boot.initrd.kernelModules = [ "amdgpu" - # "modesetting" - # "nvidia" - # "nvidia-drm" - # "nvidiafb" - # # "nvidia-uvm" - # "nvidia-modeset" - # "i2c-nvidia_gpu" + "nvidia" + # # "nvidia-drm" + # # "nvidiafb" + # # # "nvidia-uvm" + # # "nvidia-modeset" + # # "i2c-nvidia_gpu" ]; boot.kernelParams = [ # "amdgpu.modeset=1" # "nvidia-drm.fbdev=1" - # "nvidia-drm.modeset=0" + # "nvidia-drm.modeset=1" # # "nvidia.NVreg_PreserveVideoMemoryAllocations=0" "amd_iommu=on" # "vfio-pci.ids=\"10de:2489,10de:228b\"" @@ -83,7 +87,7 @@ in hardware.nvidia = { # Modesetting is required. modesetting.enable = true; - + # Nvidia power management. Experimental, and can cause sleep/suspend to fail. # Enable this if you have graphical corruption issues or application crashes after waking # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead @@ -111,7 +115,7 @@ in package = config.boot.kernelPackages.nvidiaPackages.beta; # package = config.boot.kernelPackages.nvidiaPackages.none; # package = config.boot.kernelPackages.nvidiaPackages.production; - + nvidiaPersistenced = true; forceFullCompositionPipeline = false; prime = { @@ -123,12 +127,11 @@ in # reverseSync.enable = false; # Make sure to use the correct Bus ID values for your system! # intelBusId = "PCI:0:2:0"; - nvidiaBusId = "PCI:01:0:0"; + nvidiaBusId = "PCI:1:0:0"; amdgpuBusId = "PCI:50:0:0"; #For AMD GPU }; }; - # Add user to extra groups users.users.andreas = { extraGroups = [ "video" "render" ]; diff --git a/systems/x86_64-linux/drivebystation-nix/configuration.nix b/systems/x86_64-linux/drivebystation-nix/configuration.nix index b9e4bd4..a1f95cf 100644 --- a/systems/x86_64-linux/drivebystation-nix/configuration.nix +++ b/systems/x86_64-linux/drivebystation-nix/configuration.nix @@ -42,29 +42,46 @@ LC_TIME = "nl_NL.UTF-8"; }; - # Enable the X11 windowing system. - services.xserver.enable = true; - - # Enable the GNOME Desktop Environment. - services.xserver.displayManager.gdm.enable = true; - services.xserver.displayManager.defaultSession = "gnome"; - # services.xserver.displayManager.lightdm.enable = true; - # services.xserver.displayManager.autoLogin.enable = true; + services.xserver = { + enable = true; # Enable the deprecated X11 teletype terminal connection system. + # Specify first device section to use nvidia GPU + #deviceSection = '' + # # Pick the 1070 + # BusID "PCI:1:0:0" + #''; + desktopManager = { + # Disable xterm + xterm.enable = false; + # Enable xfce session + xfce = { + enable = true; + }; + # Enable Gnome Session + gnome.enable = true; + # Disable fuckshit plasma + plasma6.enable = false; + }; + # Configure Display Manager + displayManager = { + gdm.enable = false; + sddm.enable = false; + # Enable lightdm + lightdm.enable = true; + defaultSession = "xfce"; + }; + # Configure keymap in X11 + xkb = { + layout = "us"; + variant = "intl"; + }; + }; + # services.xserver.displayManager.defaultSession = "gnome-x11"; # services.xserver.displayManager.autoLogin.enable = true; # services.xserver.displayManager.autoLogin.user = "andreas"; # systemd.services."getty@tty1".enable = false; # systemd.services."autovt@tty1".enable = false; - services.xserver.desktopManager.gnome.enable = true; - services.desktopManager.plasma6.enable = true; - programs.ssh.askPassword = "${pkgs.x11_ssh_askpass}/libexec/x11-ssh-askpass"; - # Configure keymap in X11 - services.xserver.xkb = { - layout = "us"; - variant = "intl"; - }; - # Configure console keymap console.keyMap = "us-acentos"; @@ -101,7 +118,8 @@ environment.systemPackages = with pkgs; [ # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. # wget - pkgs.gnome-tweaks + xfce.xfce4-whiskermenu-plugin + gnome-tweaks ]; # Some programs need SUID wrappers, can be configured further or are diff --git a/systems/x86_64-linux/drivebystation-nix/hardware/acer-monitor-edid.nix b/systems/x86_64-linux/drivebystation-nix/hardware/acer-monitor-edid.nix index abb354d..28d216c 100644 --- a/systems/x86_64-linux/drivebystation-nix/hardware/acer-monitor-edid.nix +++ b/systems/x86_64-linux/drivebystation-nix/hardware/acer-monitor-edid.nix @@ -1,6 +1,6 @@ { config, lib, pkgs, ... }: { - boot.kernelParams = [ "drm.edid_firmware=DP-6:edid/edid.bin" ]; + boot.kernelParams = [ "drm.edid_firmware=DP-1:edid/edid.bin" ]; hardware.firmware = [ (