dotfiles
My PC Dotfiles & Websitegit clone https://github.com/maydayv7/dotfiles
commit ad214cb678555fe9e93b8bc51dd5a3636370f182 parent 2fe64e0a469416b29886222d1615bd663924b5cd Author: maydayv7 <maydayv7@gmail.com> Date: Mon, 16 Sep 2024 23:44:50 +0530 fix(`valkyrie`): NVIDIA Issues + Also improve GNOME settings + Add some Sound apps + Add specialisations for Power Modes
Diffstat:
| M | devices/valkyrie/default.nix | | | 2 | +- |
| M | devices/valkyrie/drivers.nix | | | 46 | ++++++++++++++++++++++++++++++---------------- |
| M | files/gnome/settings/default.nix | | | 2 | +- |
| M | files/gnome/settings/extensions.nix | | | 3 | ++- |
| M | modules/apps/office.nix | | | 11 | ++++++++++- |
| M | modules/apps/spotify.nix | | | 6 | +++--- |
| M | modules/base/firmware.nix | | | 1 | + |
| M | modules/gui/desktop/gnome/default.nix | | | 6 | ++++++ |
| M | modules/gui/xorg.nix | | | 2 | +- |
| M | modules/hardware/default.nix | | | 12 | ++++++++---- |
| M | modules/hardware/virtualisation/android.nix | | | 2 | +- |
| M | modules/hardware/virtualisation/default.nix | | | 26 | ++++++++++++++++---------- |
12 files changed, 80 insertions(+), 39 deletions(-)
diff --git a/devices/valkyrie/default.nix b/devices/valkyrie/default.nix @@ -19,7 +19,7 @@ vm.android.enable = false; cpu = { cores = 8; - mode = "performance"; + mode = "powersave"; }; }; diff --git a/devices/valkyrie/drivers.nix b/devices/valkyrie/drivers.nix @@ -1,28 +1,42 @@ { + config, lib, pkgs, ... -}: { - services.fwupd.enable = true; +}: let + inherit (lib) mkForce; + mode = config.hardware.cpu.mode == "performance"; +in { user.persist.directories = [".config/rog"]; + services = { + fwupd.enable = true; + xserver.videoDrivers = mkForce ["nvidia"]; + }; + hardware = { vm.passthrough = ["10de:28e0" "10de:22be"]; - nvidia.prime = { - nvidiaBusId = lib.mkForce "PCI:1:0:0"; - amdgpuBusId = lib.mkForce "PCI:65:0:0"; - sync.enable = false; - offload = { - enable = true; - enableOffloadCmd = true; + nvidia = { + dynamicBoost.enable = true; + prime = { + nvidiaBusId = mkForce "PCI:1:0:0"; + amdgpuBusId = mkForce "PCI:101:0:0"; + sync.enable = mkForce mode; + offload = { + enable = mkForce (!mode); + enableOffloadCmd = mkForce (!mode); + }; }; }; }; - systemd.services.mic-boost = { - description = "Fix Internal Microphone"; - wantedBy = ["multi-user.target"]; - script = '' - ${lib.getExe' pkgs.alsa-utils "amixer"} -c 2 sset 'Internal Mic Boost' 0 - ''; - }; + user.homeConfig.home.file.".config/autostart/mic-boost.desktop".text = '' + [Desktop Entry] + Type=Application + Name=mic-boost + Exec=${pkgs.writeShellApplication { + name = "mic"; + text = "amixer -c 2 sset 'Internal Mic Boost' 0"; + runtimeInputs = with pkgs; [alsa-utils]; + }}/bin/mic + ''; } diff --git a/files/gnome/settings/default.nix b/files/gnome/settings/default.nix @@ -115,7 +115,7 @@ in { "org/gnome/desktop/wm/preferences" = { button-layout = "appmenu:minimize,maximize,close"; - focus-mode = "sloppy"; + focus-mode = "mouse"; titlebar-font = "${builtins.head fonts.sansSerif} Bold 11"; visual-bell = false; }; diff --git a/files/gnome/settings/extensions.nix b/files/gnome/settings/extensions.nix @@ -110,6 +110,8 @@ hot-sensors = ["_default_icon_"]; show-battery = true; show-storage = false; + show-gpu = true; + include-static-gpu-info = false; }; } { @@ -387,7 +389,6 @@ } ] ++ optionals sys.gui.fancy [ - {package = wiggle;} {package = rounded-window-corners-reborn;} {package = transparent-top-bar;} { diff --git a/modules/apps/office.nix b/modules/apps/office.nix @@ -40,6 +40,10 @@ in { whatsapp-for-linux zoom-us + # Sound + pwvucontrol + qpwgraph + # Utilities hunspell hunspellDicts.en_US-large @@ -55,7 +59,12 @@ in { user = { # Persisted Files - persist.files = [".config/gscan2pdfrc" ".config/zoomus.conf"]; + persist.files = [ + ".config/gscan2pdfrc" + ".config/rncbc.org/qpwgraph" + ".config/zoomus.conf" + ]; + persist.directories = [ ".calibre" ".thunderbird" diff --git a/modules/apps/spotify.nix b/modules/apps/spotify.nix @@ -28,7 +28,7 @@ in { colorScheme = "custom"; customColorScheme = with config.lib.stylix.colors; { - "text" = "${base0C}"; + "text" = "${base07}"; "subtext" = "${base05}"; "nav-active-text" = "${bright-green}"; "main" = "${base00}"; @@ -37,14 +37,14 @@ in { "card" = "${base00}"; "shadow" = "${base02}"; "main-secondary" = "${base01}"; - "button" = "${base0C}"; + "button" = "${base07}"; "button-secondary" = "${green}"; "button-active" = "${base0D}"; "button-disabled" = "${base0D}"; "nav-active" = "${base0D}"; "play-button" = "${green}"; "tab-active" = "${yellow}"; - "notification" = "${base0C}"; + "notification" = "${base07}"; "notification-error" = "${orange}"; "playback-bar" = "${bright-green}"; "misc" = "${bright-green}"; diff --git a/modules/base/firmware.nix b/modules/base/firmware.nix @@ -36,6 +36,7 @@ # Network Settings user.groups = ["networkmanager"]; environment.persist.directories = [ + "/var/lib/alsa" "/etc/NetworkManager/system-connections" "/etc/ssh" "/var/lib/bluetooth" diff --git a/modules/gui/desktop/gnome/default.nix b/modules/gui/desktop/gnome/default.nix @@ -77,6 +77,7 @@ in { services = { udev.packages = [pkgs.gnome.gnome-settings-daemon]; telepathy.enable = true; + switcherooControl.enable = true; gnome = { core-developer-tools.enable = true; gnome-remote-desktop.enable = true; @@ -87,6 +88,11 @@ in { apps.list = ["firefox"]; programs = { gnupg.agent.pinentryPackage = mkForce pkgs.pinentry.gnome3; + nautilus-open-any-terminal = { + enable = true; + terminal = "blackbox"; + }; + kdeconnect = { enable = true; package = pkgs.gnomeExtensions.gsconnect; diff --git a/modules/gui/xorg.nix b/modules/gui/xorg.nix @@ -17,7 +17,7 @@ autorun = true; # Driver Settings - videoDrivers = ["modesetting"]; + videoDrivers = lib.mkDefault ["modesetting"]; }; # System Specialisation diff --git a/modules/hardware/default.nix b/modules/hardware/default.nix @@ -6,7 +6,7 @@ ... }: let inherit (util.map) modules; - inherit (lib) mkOption types; + inherit (lib) mkForce mkOption types; cfg = config.hardware; in { imports = modules.list ./.; @@ -37,10 +37,14 @@ in { type = listOf (enum (modules.name ./.)); default = []; }; + }; - config = { - powerManagement.cpuFreqGovernor = cfg.cpu.mode; - nix.settings.max-jobs = cfg.cpu.cores; + config = { + powerManagement.cpuFreqGovernor = cfg.cpu.mode; + nix.settings.max-jobs = cfg.cpu.cores; + specialisation = { + powersave.configuration.hardware.cpu.mode = mkForce "powersave"; + performance.configuration.hardware.cpu.mode = mkForce "performance"; }; }; } diff --git a/modules/hardware/virtualisation/android.nix b/modules/hardware/virtualisation/android.nix @@ -28,7 +28,7 @@ in { ''; #!# Run the following command to install the image: - #!# sudo waydroid init -s GAPPS -f + #!# waydroid init -s GAPPS -f virtualisation.waydroid.enable = true; environment.systemPackages = [pkgs.wl-clipboard]; diff --git a/modules/hardware/virtualisation/default.nix b/modules/hardware/virtualisation/default.nix @@ -5,7 +5,7 @@ ... }: let inherit (builtins) concatStringsSep elem; - inherit (lib) mkEnableOption mkIf mkMerge mkOption types; + inherit (lib) mkEnableOption mkForce mkIf mkMerge mkOption types; enable = elem "virtualisation" config.hardware.support; cfg = config.hardware.vm; in { @@ -32,12 +32,9 @@ in { user.persist.directories = [".config/libvirt" ".local/share/libvirt"]; environment.persist.directories = ["/var/lib/libvirt"]; security.virtualisation.flushL1DataCache = "cond"; - specialisation.vfio.configuration.hardware.vm.vfio = true; boot = { kernelModules = ["kvm-amd" "kvm-intel"]; - extraModprobeConfig = '' - options kvm_intel nested=1 - ''; + extraModprobeConfig = "options kvm_intel nested=1"; }; # VM Packages @@ -63,23 +60,32 @@ in { }; }; }; + + # VFIO Configuration + specialisation.vfio.configuration.hardware = { + vm.vfio = true; + cpu.mode = mkForce "performance"; + }; } (mkIf cfg.vfio { - # VFIO Configuration system.nixos.tags = ["vfio"]; boot = { kernelParams = [ - "amd_iommu=on" - "intel_iommu=on" + "amd_iommu=pt" + "intel_iommu=pt" "i915.enable_gvt=1" + "iommu=pt" + "kvm.ignore_msrs=1" + "kvm.report_ignored_msrs=0" ("vfio-pci.ids=" + concatStringsSep "," cfg.passthrough) ]; kernelModules = [ "vfio" - "vfio-pci" - "vfio_virqfd" + "vfio_pci" "vfio_iommu_type1" + "vfio_virqfd" + "nvidia" "nvidia_modeset" "nvidia_uvm"