From c2ac689be0b8a26b4b5ec118bc6bc9adcb55800a Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Tue, 17 Sep 2024 21:03:44 -0400 Subject: update wayland and nvidia settings; update nvim configs --- modules/desktop/apps/editors/neovim.nix | 1 - modules/desktop/apps/editors/vscode.nix | 3 +- modules/desktop/apps/mpd.nix | 6 +++- modules/desktop/apps/mutt-wizard.nix | 26 ++++++++++++++++ modules/desktop/apps/virt.nix | 4 +++ modules/desktop/hyprland.nix | 55 ++++++++++++++++++++------------- modules/hardware/gpu.nix | 35 ++++++++++++--------- 7 files changed, 90 insertions(+), 40 deletions(-) create mode 100644 modules/desktop/apps/mutt-wizard.nix (limited to 'modules') diff --git a/modules/desktop/apps/editors/neovim.nix b/modules/desktop/apps/editors/neovim.nix index ee6424b..bc3ff86 100644 --- a/modules/desktop/apps/editors/neovim.nix +++ b/modules/desktop/apps/editors/neovim.nix @@ -24,7 +24,6 @@ in { }; home.packages = [ - pkgs.rnix-lsp pkgs.ccls pkgs.nodePackages.bash-language-server pkgs.texlab diff --git a/modules/desktop/apps/editors/vscode.nix b/modules/desktop/apps/editors/vscode.nix index f2db004..39c6e03 100644 --- a/modules/desktop/apps/editors/vscode.nix +++ b/modules/desktop/apps/editors/vscode.nix @@ -18,11 +18,10 @@ in { config = lib.mkIf (codeConf.enable) { home.manager.programs.vscode = { enable = true; - package = pkgs.vscode; + package = pkgs.vscode.fhs; extensions = with pkgs.vscode-extensions; [ catppuccin.catppuccin-vsc catppuccin.catppuccin-vsc-icons - ms-dotnettools.csharp ]; }; }; diff --git a/modules/desktop/apps/mpd.nix b/modules/desktop/apps/mpd.nix index e7af8c3..f37c465 100644 --- a/modules/desktop/apps/mpd.nix +++ b/modules/desktop/apps/mpd.nix @@ -18,7 +18,6 @@ in config = lib.mkIf (mpdConfig.enable) { home.packages = [ pkgs.mpc-cli - pkgs.ncmpcpp ]; services.mpd = { @@ -34,6 +33,11 @@ audio_output { }; systemd.services.mpd.environment = { XDG_RUNTIME_DIR = "/run/user/1000"; + }; + + home.manager.programs.ncmpcpp = { + enable = true; + mpdMusicDir = /home/jon/mus; }; }; } diff --git a/modules/desktop/apps/mutt-wizard.nix b/modules/desktop/apps/mutt-wizard.nix new file mode 100644 index 0000000..3b8a5db --- /dev/null +++ b/modules/desktop/apps/mutt-wizard.nix @@ -0,0 +1,26 @@ +{ + config, + options, + lib, + pkgs, + ... +}: let + muttConfig = config.modules.desktop.apps.mutt; +in +{ + options.modules.desktop.apps.mutt = { + enable = lib.mkOption { + type = lib.types.bool; + default = false; + }; + }; + + config = lib.mkIf (muttConfig.enable) { + home.packages = [ + pkgs.neomutt + pkgs.isync + pkgs.lynx + pkgs.mutt-wizard + ]; + }; +} diff --git a/modules/desktop/apps/virt.nix b/modules/desktop/apps/virt.nix index 5851a0b..a9eaef4 100644 --- a/modules/desktop/apps/virt.nix +++ b/modules/desktop/apps/virt.nix @@ -16,6 +16,10 @@ in }; config = lib.mkIf (virtConfig.enable) { + home.packages = [ + pkgs.virtiofsd + ]; + virtualisation.libvirtd = { enable = true; qemu = { diff --git a/modules/desktop/hyprland.nix b/modules/desktop/hyprland.nix index 5e35608..134d52f 100644 --- a/modules/desktop/hyprland.nix +++ b/modules/desktop/hyprland.nix @@ -135,13 +135,17 @@ in { }; }; }; - extraPortals = [pkgs.xdg-desktop-portal-gtk]; - config.common.default = ["wlr" "gtk"]; + extraPortals = [ + pkgs.xdg-desktop-portal-gtk + pkgs.xdg-desktop-portal-hyprland + ]; + config.common.default = ["wlr" "gtk" "hyprland" ]; }; home.manager.wayland.windowManager.hyprland = { enable = true; xwayland.enable = hyprlandConf.xwayland; + systemd.enable = true; settings = { "$mod" = "SUPER"; @@ -171,22 +175,41 @@ in { "swww img ${configDir}/hypr/wallpaper.png" ]; - env = [ + env = lib.mkMerge [ + ([ "XDG_CURRENT_DESKTOP,Hyprland" "XDG_SESSION_TYPE,wayland" "XDG_SESSION_DESKTOP,Hyprland" - "GDK_BACKEND=wayland,x11" - "QT_QPA_PLATFORM=wayland;xcb" - "CLUTTER_BACKEND=wayland" - "QT_WAYLAND_DISABLE_WINDOWDECORATION,1" + "GDK_BACKEND,wayland,x11" + "SDL_VIDEODRIVER,wayland" + "CLUTTER_BACKEND,wayland" + "MOZ_ENABLE_WAYLAND,1" + "MOZ_DISABLE_RDD_SANDBOX,1" + "_JAVA_AWT_WM_NONREPARENTING,1" "QT_AUTO_SCREEN_SCALE_FACTOR,1" - - "SDL_VIDEODRIVER=wayland" + "QT_QPA_PLATFORM,wayland" + "QT_WAYLAND_DISABLE_WINDOWDECORATION,1" - "disable_hyprland_logo=true" + "disable_hyprland_logo,true" "force_default_wallpaper,0" - ]; + ]) + ( lib.mkIf (config.modules.device.gpu == "nvidia") + [ + "GBM_BACKEND,nvidia" + "__GLX_VENDOR_LIBRARY_NAME,nvidia" + "LIBVA_DRIVER_NAME,nvidia" + "NVD_BACKEND,direct" + "PROTON_ENABLE_NGX_UPDATER,1" + "__GL_GSYNC_ALLOWED,1" + "__GL_VRR_ALLOWED,1" + "__GL_MaxFramesAllowed,1" + "__NV_PRIME_RENDER_OFFLOAD,1" + "__VK_LAYER_NV_optimus,NIVIDA_only" + "WLR_DRM_NO_ATOMIC,1" + "WLR_USE_LIBINPUT,1" + "WLR_RENDERER_ALLOW_SOFTWARE,1" + ])]; decoration = decoration; animations = animations; @@ -209,16 +232,6 @@ in { security.pam.services.swaylock = {}; } - (lib.mkIf (device.gpu == "nvidia") { - home.manager.wayland.windowManager.hyprland.settings.env = [ - "GBM_BACKEND=nvidia-drm" - "__GLX_VENDOR_LIBRARY_NAME=nvidia" - "LIBVA_DRIVER_NAME=nvidia" - "__GL_GSYNC_ALLOWED" - "__GL_VRR_ALLOWED" - "WLR_DRM_NO_ATOMIC=1" - ]; - }) (lib.mkIf (config.modules.desktop.greetd.enable) { services.greetd.settings = { default_session.command = '' diff --git a/modules/hardware/gpu.nix b/modules/hardware/gpu.nix index fd696ab..bb8b831 100644 --- a/modules/hardware/gpu.nix +++ b/modules/hardware/gpu.nix @@ -17,10 +17,8 @@ in { config = lib.mkIf (gpuConfig.enable) (lib.mkMerge [ { - hardware.opengl = { + hardware.graphics = { enable = true; - driSupport = true; - driSupport32Bit = true; }; } (lib.mkIf (device.gpu == "intel") { @@ -38,24 +36,31 @@ in { environment.variables.VDPAU_DRIVER = "va_gl"; }) (lib.mkIf (device.gpu == "nvidia") { + boot = { + extraModulePackages = [ + config.boot.kernelPackages.nvidia_x11_beta + ]; + initrd.kernelModules = [ + "nvidia" + "nvidia_modeset" + "nvidia_uvm" + "nvidia_drm" + ]; + blacklistedKernelModules = [ "nouveau" ]; + }; + + environment.systemPackages = with pkgs; [ + pkgs.nvidia-vaapi-driver + ]; + services.xserver.videoDrivers = ["nvidia"]; hardware.nvidia = { modesetting.enable = true; - powerManagement.enable = false; - powerManagement.finegrained = false; + powerManagement.enable = true; open = false; nvidiaSettings = true; - package = config.boot.kernelPackages.nvidiaPackages.production; + package = config.boot.kernelPackages.nvidiaPackages.beta; }; - boot.initrd.kernelModules = [ - "nvidia" - "nvidia_modeset" - "nvidia_uvm" - "nvidia_drm" - ]; - boot.extraModprobeConfig = '' - options nvidia-drm modeset=1 - ''; }) ]); } -- cgit v1.2.1