diff --git a/] b/] new file mode 100644 index 0000000..cbd7a01 --- /dev/null +++ b/] @@ -0,0 +1,474 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, master, lib, inputs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + # Bootloader. + boot.loader.grub.enable = true; + boot.loader.grub.devices = ["nodev"]; + boot.loader.grub.useOSProber = true; + boot.loader.grub.efiSupport = true; + boot.initrd.systemd.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.loader.grub.timeoutStyle = "hidden"; + services.avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; +}; + + +boot = { + + plymouth = { + enable = true; + theme = "square_hud"; + themePackages = with pkgs; [ + # By default we would install all themes + (adi1090x-plymouth-themes.override { + selected_themes = [ "square_hud" ]; + }) + ]; + }; + + # Enable "Silent Boot" + consoleLogLevel = 0; + initrd.verbose = false; + kernelPackages = pkgs.linuxPackages_zen; + /*kernelPatches = [ + { + name = "dsc"; + patch = ../../patches/vesa-dsc-fixed-bpp.patch; + } + ];*/ + kernelParams = [ + "quiet" + "splash" + "boot.shell_on_fail" + "loglevel=3" + "rd.systemd.show_status=false" + "rd.udev.log_level=3" + "udev.log_priority=3" + ]; + # Hide the OS choice for bootloaders. + # It's still possible to open the bootloader list by pressing any key + # It will just not appear on screen unless a key is pressed + loader.timeout = 0; + + }; + + services.udev.extraRules = '' + ACTION=="add", KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="35bd", ATTRS{idProduct}=="0101", TAG+="uaccess", MODE="0660" + ''; + + boot.extraModulePackages = with config.boot.kernelPackages; [ hid-tmff2 ]; + + networking.hostName = "nixos"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + + # Enable networking + networking.networkmanager.enable = true; + security.pki.certificateFiles = [ ./certs/beammp.pem ]; + + + hardware.bluetooth.enable = true; + hardware.bluetooth.package = pkgs.bluez; + + nixpkgs.config.permittedInsecurePackages = [ + "electron-31.7.7" + "mbedtls-2.28.10" + ]; + + environment.variables.AMD_VULKAN_ICD = "RADV"; + + # Set your time zone. + time.timeZone = "America/Chicago"; + environment.sessionVariables.NIXOS_OZONE_WL = "1"; + environment.sessionVariables.SDL_GAMECONTROLLERCONFIG = "03002f67c4100000c082000011010000,Shifter,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,platform:Linux"; + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + + # Enable the X11 windowing sytem. + services.xserver.enable = true; + + + # Enable the GNOME Desktop Environment. + services.desktopManager.plasma6.enable = false; + services.displayManager.sddm.enable = false; + services.displayManager.cosmic-greeter.enable = false; + services.desktopManager.cosmic.enable = true; + services.desktopManager.gnome.enable = false; + services.displayManager.gdm.enable = false; + /*services.displayManager = { + autoLogin.enable = true; + autoLogin.user = "joshuaelm"; +};*/ + security.pam.services.hyprlock = {}; + programs.noisetorch.enable = true; + + services.greetd = { + enable = true; + settings = rec { + initial_session = { + command = "dbus-launch ${pkgs.hyprland}/bin/Hyprland"; + user = "joshuaelm"; + }; + default_session = initial_session; + }; + }; + + # Steam Deck Gamemode + programs.steam.gamescopeSession.enable = true; + + + # Polkit + + security.polkit.enable = true; + services.udisks2.enable = true; + + + # Configure keymap in X11 + services.xserver = { + xkb.layout = "us"; + xkb.variant = ""; + excludePackages = [ pkgs.xterm ]; + }; + + + + # Enable Swap + + /*swapDevices = [ { + device = "/var/lib/swapfile"; + size = 16*1024; + }];*/ + + # Enable CUPS to print documents. + services.printing.enable = true; + + # Enable sound with pipewire. + services.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + wireplumber.enable = true; + # If you want to use JACK applications, uncomment this + #jack.enable = true; + + # use the example session manager (no others are packaged yet so this is enabled by default, + # no need to redefine it in your config for now) + #media-session.enable = true; + wireplumber.configPackages = [ + (pkgs.writeTextDir "share/wireplumber/wireplumber.conf.d/alsa.conf" '' + monitor.alsa.rules = [ + { + matches = [ + { + device.name = "~alsa_card.*" + } + ] + actions = { + update-props = { + # Device settings + api.alsa.use-acp = true + } + } + } + { + matches = [ + { + node.name = "~alsa_input.*" + } + { + node.name = "~alsa_output.*" + } + ] + actions = { + # Node settings + update-props = { + session.suspend-timeout-seconds = 0 + } + } + } + ] + '') + ]; + + }; + services.pulseaudio.configFile = pkgs.runCommand "default.pa" {} '' + sed 's/module-udev-detect$/module-udev-detect tsched=0/' \ + ${pkgs.pulseaudio}/etc/pulse/default.pa > $out +''; + environment.etc."wireplumber/main.lua.d/90-suspend-timeout.lua" = { + text = '' + session.suspend-timeout-seconds = 0 + ''; + }; + + services.pipewire.extraConfig.pipewire-pulse."92-low-latency" = { + context.modules = [ + { + name = "libpipewire-module-protocol-pulse"; + args = { + pulse.min.req = "32/48000"; + pulse.default.req = "32/48000"; + pulse.max.req = "32/48000"; + pulse.min.quantum = "32/48000"; + pulse.max.quantum = "32/48000"; + }; + } + ]; + stream.properties = { + node.latency = "32/48000"; + resample.quality = 1; + }; +}; +hardware.pulseaudio.extraConfig = '' + .nofail + unload-module module-suspend-on-idle + .fail +''; + + + # Enable touchpad support (enabled default in most desktopManager). + # services.xserver.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + programs.adb.enable = true; + users.users.joshuaelm = { + isNormalUser = true; + description = "Joshua Elmasri"; + extraGroups = [ "networkmanager" "input" "wheel" "adbusers" ]; + packages = with pkgs; [ + # thunderbird + ]; + shell = pkgs.fish; + }; + + programs.fish.enable = true; + + nix.optimise.automatic = true; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # Configure drives + + fileSystems."/mnt/Games" = { + device = "/dev/nvme0n1p1"; + fsType = "btrfs"; + options = [ + "users" + "nofail" + "x-gvfs-show" + "exec" + ]; + }; + + + /*fileSystems."/mnt/More-Games" = { + device = "/dev/sdb1"; + fsType = "btrfs"; + options = [ + "users" + "nofail" + "x-gvfs-show" + "exec" + ]; + };*/ + + + + + + + # Fonts + fonts.packages = with pkgs; [ + fira-code + fira-code-symbols + roboto + nerd-fonts.fira-code + nerd-fonts.jetbrains-mono + ]; + + + services.moltengamepad.enable = true; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + (pkgs.buildFHSEnv { + name = "fhs"; + targetPkgs = pkgs: with pkgs; [ + alsa-lib atk cairo cups curl dbus expat file fish fontconfig freetype + fuse glib gtk3 libGL libnotify libxml2 libxslt netcat nspr nss openjdk8 + openssl.dev cava pango appimage-run pkg-config strace udev vulkan-loader watch wget which + xorg.libX11 icu xorg.libxcb xorg.libXcomposite xorg.libXcursor + xorg.libXdamage xorg.libXext xorg.libXfixes xorg.libXi xorg.libXrandr + xorg.libXrender xorg.libXScrnSaver openssl xorg.libxshmfence xorg.libXtst + xorg.xcbutilkeysyms zlib fontconfig.lib SDL2 libGL libuuid xorg.libXft + ]; + profile = ''export FHS=1''; + runScript = "fish"; + }) + git + bibata-cursors + killall + usbutils + mangohud + # cemu broken with latest update + oterm + wget + wlx-overlay-s + labymod-launcher + unzip + winetricks + cowsay + pfetch + ryubing + gomatrix + python3 + pavucontrol + bluebubbles + xfce.thunar + parallel-launcher + wiremix + termsonic + steamtinkerlaunch + kdePackages.kdenlive + wineWowPackages.wayland + blueman + lapce + prismlauncher + protonup-qt + openjdk23 + heroic + protontricks + gamescope + playerctl + wine + #alvr + libreoffice + neovide + flatpak + ]; + + # VirtualBox + + virtualisation.virtualbox.host.enable = false; + users.extraGroups.vboxusers.members = [ "user-with-access-to-virtualbox" ]; + + services.flatpak.enable = true; + + + services.sunshine = { + enable = true; + autoStart = false; + capSysAdmin = true; + openFirewall = true; + + }; + # Enable Steam + programs.steam = { + enable = true; + remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play + dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server + }; + hardware.steam-hardware.enable=true; + services.monado = { + enable = true; + defaultRuntime = true; # Register as default OpenXR runtime + }; + systemd.user.services.monado.environment = { + STEAMVR_LH_ENABLE = "1"; + XRT_COMPOSITOR_COMPUTE = "1"; + WMR_HANDTRACKING = "0"; + }; + + + nixpkgs.config.packageOverrides = pkgs: { + steam = pkgs.steam.override { + extraLibraries = pkgs: [ pkgs.xorg.libxcb ]; + extraPkgs = pkgs: with pkgs; [ + xorg.libXcursor + xorg.libXi + xorg.libXinerama + xorg.libXScrnSaver + libpng + libpulseaudio + libvorbis + stdenv.cc.cc.lib + libkrb5 + keyutils + ]; + }; + }; + + programs.gamescope = { + enable = true; + capSysNice = true; + }; + + programs.nix-ld.enable = true; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + services.openssh.enable = true; + services.openssh.allowSFTP = true; + services.openssh.settings.PasswordAuthentication = true; + + # Open ports in the firewall. + networking.firewall.allowedTCPPorts = [ 7860 3042 3246 9943 9944 7801 11434 47990 48010 5001 ]; + networking.firewall.allowedUDPPorts = [ 7860 9943 9944 3042 47990 3246 11434 7801 4800 48010 ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "23.11"; # Did you read the comment? + # Enable lakes + nix = { + extraOptions = '' + experimental-features = nix-command flakes + ''; +}; + +} diff --git a/flake.lock b/flake.lock index e336f5f..f5f2bd8 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1761246688, - "narHash": "sha256-U2r3/DKgr9Fq1yqWLCbKMSqRf8a1JctD0kj/ftBClsg=", + "lastModified": 1762527355, + "narHash": "sha256-d5zsOdWeHZFP5Pc/QkgsX3UKkVDmcwY8nSJJJszMwVM=", "owner": "aylur", "repo": "astal", - "rev": "189bf73016c26d7d32729a913d6436cd7b1a0885", + "rev": "5baeb660214bcafc9ae0b733a1bc84f5fa6078f4", "type": "github" }, "original": { @@ -127,11 +127,11 @@ ] }, "locked": { - "lastModified": 1760948891, - "narHash": "sha256-TmWcdiUUaWk8J4lpjzu4gCGxWY6/Ok7mOK4fIFfBuU4=", + "lastModified": 1762980239, + "narHash": "sha256-8oNVE8TrD19ulHinjaqONf9QWCKK+w4url56cdStMpM=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "864599284fc7c0ba6357ed89ed5e2cd5040f0c04", + "rev": "52a2caecc898d0b46b2b905f058ccc5081f842da", "type": "github" }, "original": { @@ -198,18 +198,20 @@ "gnome-shell": { "flake": false, "locked": { - "lastModified": 1748186689, - "narHash": "sha256-UaD7Y9f8iuLBMGHXeJlRu6U1Ggw5B9JnkFs3enZlap0=", + "host": "gitlab.gnome.org", + "lastModified": 1762869044, + "narHash": "sha256-nwm/GJ2Syigf7VccLAZ66mFC8mZJFqpJmIxSGKl7+Ds=", "owner": "GNOME", "repo": "gnome-shell", - "rev": "8c88f917db0f1f0d80fa55206c863d3746fa18d0", - "type": "github" + "rev": "680e3d195a92203f28d4bf8c6e8bb537cc3ed4ad", + "type": "gitlab" }, "original": { + "host": "gitlab.gnome.org", "owner": "GNOME", - "ref": "48.2", + "ref": "gnome-49", "repo": "gnome-shell", - "type": "github" + "type": "gitlab" } }, "home-manager": { @@ -219,11 +221,11 @@ ] }, "locked": { - "lastModified": 1761316995, - "narHash": "sha256-BAAjCpjTnfaxtc9NCkbUl9MUv5JmAG5qU7/G8TTHmb4=", + "lastModified": 1763416652, + "narHash": "sha256-8EBEEvtzQ11LCxpQHMNEBQAGtQiCu/pqP9zSovDSbNM=", "owner": "nix-community", "repo": "home-manager", - "rev": "82b58f38202540bce4e5e00759d115c5a43cab85", + "rev": "ea164b7c9ccdc2321379c2ff78fd4317b4c41312", "type": "github" }, "original": { @@ -262,11 +264,11 @@ }, "master": { "locked": { - "lastModified": 1761323738, - "narHash": "sha256-4wAJWLQq2gdkFzp72sSnNtzZb8H7yKEqlf+ABZfEibk=", + "lastModified": 1763589965, + "narHash": "sha256-0qOjIJ4Ryb0Le8BCHQz0MD8hM6YiTFG6hqECrI5hOag=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "385f0a2ebbff162a2ba67c72e6ab2f21f5a2f006", + "rev": "5be29d57cf172299d57cac5d2107ddfe2278aaca", "type": "github" }, "original": { @@ -284,11 +286,11 @@ ] }, "locked": { - "lastModified": 1761319449, - "narHash": "sha256-6mYaajlXqx0ihAIROsIn5UZgKrpjd53sgou25p19i5o=", + "lastModified": 1763329080, + "narHash": "sha256-S6eZaiRZPvSWv9d2kZO+HrYTelWqn++vsC/bUwOSQ7I=", "owner": "tpwrules", "repo": "nixos-apple-silicon", - "rev": "cff3fa31234c130b115d06fb5080f6d05cd69700", + "rev": "bc52b0623f4367447347cbcc88522ec64486d710", "type": "github" }, "original": { @@ -299,11 +301,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1761114652, - "narHash": "sha256-f/QCJM/YhrV/lavyCVz8iU3rlZun6d+dAiC3H+CDle4=", + "lastModified": 1763421233, + "narHash": "sha256-Stk9ZYRkGrnnpyJ4eqt9eQtdFWRRIvMxpNRf4sIegnw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "01f116e4df6a15f4ccdffb1bcd41096869fb385c", + "rev": "89c2b2330e733d6cdb5eae7b899326930c2c0648", "type": "github" }, "original": { @@ -322,11 +324,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1761309195, - "narHash": "sha256-DUtt6LE+9TC0/HTg+sQb0uWuw7uSDhqYmKesGEy3Shk=", + "lastModified": 1763565747, + "narHash": "sha256-FgCL7pEFgZjaYoiDbY+f9fAwHqgVNSZEkcLUvTnhwHw=", "owner": "nix-community", "repo": "nixvim", - "rev": "fa8240195abc88a1a161e8d3e2a5b42a5d54b5df", + "rev": "82bc02466cccb7594aef296aea128b9b59621efe", "type": "github" }, "original": { @@ -370,11 +372,11 @@ ] }, "locked": { - "lastModified": 1760652422, - "narHash": "sha256-C88Pgz38QIl9JxQceexqL2G7sw9vodHWx1Uaq+NRJrw=", + "lastModified": 1761730856, + "narHash": "sha256-t1i5p/vSWwueZSC0Z2BImxx3BjoUDNKyC2mk24krcMY=", "owner": "NuschtOS", "repo": "search", - "rev": "3ebeebe8b6a49dfb11f771f761e0310f7c48d726", + "rev": "e29de6db0cb3182e9aee75a3b1fd1919d995d85b", "type": "github" }, "original": { @@ -416,11 +418,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1761028816, - "narHash": "sha256-s1XiIeJHpODVWfzsPaK9e21iz1dQSCU3H4/1OxOsyps=", + "lastModified": 1763590746, + "narHash": "sha256-bsEu7Ohdo2OEudXdQzk+jc9fiO0rNMGaH+Wee7FXxNc=", "owner": "danth", "repo": "stylix", - "rev": "b81dc0a385443099e7d231fe6275189e32c3b760", + "rev": "3013f98e28e52b3bd3859b0c454554aae54d5060", "type": "github" }, "original": { @@ -565,11 +567,11 @@ ] }, "locked": { - "lastModified": 1761269012, - "narHash": "sha256-/naxU8jbaoZM3CQCjJiI6Z5+vsv+zA7eZdhFY1tbzsM=", + "lastModified": 1763521945, + "narHash": "sha256-Zcrafbe4niRJMbzaVOwg7+iedJhwBFttre2DpyCC6qA=", "owner": "0xc000022070", "repo": "zen-browser-flake", - "rev": "c7f5f0122cf8c4bfd9ef3b138eb615f0e54f1459", + "rev": "24d7381b9231c23daceec5d372cc28e877f7785d", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 36eb9e3..7c1360c 100644 --- a/flake.nix +++ b/flake.nix @@ -30,11 +30,18 @@ }; outputs = { self, stylix, astal, nixpkgs, home-manager, zen-browser, master, nixos-apple-silicon, nixvim }@inputs: - { + let + system = "x86_64-linux"; + lib = nixpkgs.lib; + pkgs = nixpkgs.legacyPackages.${system}; + pkgs-master = master.legacyPackages.${system}; + username = "joshuaelm"; + name = "Joshua"; + in { nixosConfigurations = { nixos = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - specialArgs = {inherit nixvim;}; + specialArgs = {inherit nixvim; inherit pkgs-master;}; specialArgs.inputs = inputs; modules = [ #stylix.nixosModules.stylix diff --git a/hosts/desktop/configuration.nix b/hosts/desktop/configuration.nix index df33468..67d3b42 100644 --- a/hosts/desktop/configuration.nix +++ b/hosts/desktop/configuration.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, master, lib, inputs, ... }: +{ config, pkgs, master, lib, pkgs-master, ... }: { imports = @@ -24,6 +24,8 @@ openFirewall = true; }; +hardware.graphics.enable = true; + boot = { @@ -42,12 +44,20 @@ boot = { consoleLogLevel = 0; initrd.verbose = false; kernelPackages = pkgs.linuxPackages_zen; - /*kernelPatches = [ - { - name = "dsc"; - patch = ../../patches/vesa-dsc-fixed-bpp.patch; + kernelPatches = [ + /*{ + name = "dsc"; + patch = ../../patches/bigscreen_1.patch; } - ];*/ + { + name = "dsc2"; + patch = ../../patches/bigscreen_2.patch; + }*/ + /*{ + name = "dsc15"; + patch = ../../patches/bigscreen_15.patch; + }*/ + ]; kernelParams = [ "quiet" "splash" @@ -64,6 +74,7 @@ boot = { }; + services.udev.extraRules = '' ACTION=="add", KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="35bd", ATTRS{idProduct}=="0101", TAG+="uaccess", MODE="0660" ''; @@ -121,6 +132,10 @@ boot = { services.desktopManager.cosmic.enable = true; services.desktopManager.gnome.enable = false; services.displayManager.gdm.enable = false; + programs.hyprland = { + withUWSM = true; + enable = true; + }; /*services.displayManager = { autoLogin.enable = true; autoLogin.user = "joshuaelm"; @@ -143,6 +158,7 @@ boot = { programs.steam.gamescopeSession.enable = true; + # Polkit security.polkit.enable = true; @@ -248,7 +264,7 @@ boot = { resample.quality = 1; }; }; -hardware.pulseaudio.extraConfig = '' +services.pulseaudio.extraConfig = '' .nofail unload-module module-suspend-on-idle .fail @@ -264,13 +280,18 @@ hardware.pulseaudio.extraConfig = '' isNormalUser = true; description = "Joshua Elmasri"; extraGroups = [ "networkmanager" "input" "wheel" "adbusers" ]; - shell = pkgs.fish; packages = with pkgs; [ # thunderbird ]; + shell = pkgs.bash; }; + /*programs.bash.interactiveShellInit = '' + if ! [ "$TERM" = "dumb" ] && [ -z "$BASH_EXECUTION_STRING" ]; then + exec nu + fi + '';*/ - programs.fish.enable = true; + programs.fish.enable = false; nix.optimise.automatic = true; @@ -317,6 +338,7 @@ hardware.pulseaudio.extraConfig = '' ]; + services.input-remapper.enable = true; # List packages installed in system profile. To search, run: # $ nix search wget @@ -340,6 +362,7 @@ hardware.pulseaudio.extraConfig = '' killall usbutils mangohud + oversteer # cemu broken with latest update oterm wget @@ -350,13 +373,14 @@ hardware.pulseaudio.extraConfig = '' cowsay pfetch ryubing - hyprpolkitagent gomatrix python3 pavucontrol bluebubbles xfce.thunar parallel-launcher + corectrl + wiremix termsonic steamtinkerlaunch kdePackages.kdenlive @@ -365,14 +389,11 @@ hardware.pulseaudio.extraConfig = '' lapce prismlauncher protonup-qt - openjdk23 heroic protontricks gamescope playerctl wine - #alvr - cava libreoffice neovide flatpak @@ -401,14 +422,20 @@ hardware.pulseaudio.extraConfig = '' }; hardware.steam-hardware.enable=true; services.monado = { - enable = true; + enable = false; defaultRuntime = true; # Register as default OpenXR runtime }; + services.wivrn.enable = true; + services.wivrn.package = pkgs-master.wivrn; + services.wivrn.defaultRuntime = true; systemd.user.services.monado.environment = { STEAMVR_LH_ENABLE = "1"; XRT_COMPOSITOR_COMPUTE = "1"; WMR_HANDTRACKING = "0"; }; + programs.alvr.enable = false; + programs.alvr.openFirewall = true; + nixpkgs.config.packageOverrides = pkgs: { @@ -449,6 +476,7 @@ hardware.pulseaudio.extraConfig = '' # Enable the OpenSSH daemon. services.openssh.enable = true; services.openssh.allowSFTP = true; + services.openssh.settings.PasswordAuthentication = true; # Open ports in the firewall. networking.firewall.allowedTCPPorts = [ 7860 3042 3246 9943 9944 7801 11434 47990 48010 5001 ]; diff --git a/hosts/desktop/hardware-configuration.nix b/hosts/desktop/hardware-configuration.nix index fd5b699..a79152a 100644 --- a/hosts/desktop/hardware-configuration.nix +++ b/hosts/desktop/hardware-configuration.nix @@ -10,16 +10,16 @@ boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/56963958-ba4d-413a-bb5e-30440a85f911"; + { device = "/dev/disk/by-uuid/6452f60b-602c-42ae-bff6-7b0a35e59bfb"; fsType = "ext4"; }; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/DC02-0B36"; + { device = "/dev/disk/by-uuid/9947-B99A"; fsType = "vfat"; options = [ "fmask=0077" "dmask=0077" ]; }; diff --git a/hosts/desktop/home.nix b/hosts/desktop/home.nix index 6e7201b..5fb8d8e 100644 --- a/hosts/desktop/home.nix +++ b/hosts/desktop/home.nix @@ -6,7 +6,7 @@ home.username = "joshuaelm"; home.homeDirectory = "/home/joshuaelm"; - imports = [ ../../modules/nvim ../../modules/stylix.nix ../../modules/hypr/hyprland_desktop.nix ../../modules/ashell ../../modules/waybar/waybar.nix ../../modules/zen ../../modules/rofi ../../modules/kitty ]; + imports = [ ../../modules/nvim ../../modules/stylix.nix ../../modules/hypr ../../modules/ashell ../../modules/waybar/waybar.nix ../../modules/zen ../../modules/rofi ../../modules/kitty ../../modules/cava ../../modules/starship ../../modules/fuzzel ../../modules/nushell ]; home.packages = [ @@ -25,7 +25,6 @@ programs.cava.enable = true; programs.btop.enable = true; services.hyprpaper.enable = true; - wayland.windowManager.hyprland.enable = true; home.shell.enableFishIntegration = true; home.file.".icons/default".source = "${pkgs.bibata-cursors}/share/icons/Bibata-Modern-Classic"; diff --git a/modules/cava/default.nix b/modules/cava/default.nix new file mode 100644 index 0000000..de1c71e --- /dev/null +++ b/modules/cava/default.nix @@ -0,0 +1,5 @@ +{pkgs, ...}: + +{ + programs.cava.enable = true; +} diff --git a/modules/fish/default.nix b/modules/fish/default.nix new file mode 100644 index 0000000..ae093c7 --- /dev/null +++ b/modules/fish/default.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: + +{ + programs.fish.enable = true; + home.shell.enableFishIntegration = true; + programs.fish.functions = { + fish_greeting = ""; + }; +} diff --git a/modules/fuzzel/default.nix b/modules/fuzzel/default.nix new file mode 100644 index 0000000..c31894d --- /dev/null +++ b/modules/fuzzel/default.nix @@ -0,0 +1,39 @@ +{pkgs, lib, config,...}: +{ + programs.fuzzel.enable = true; + programs.fuzzel.settings = lib.mkAfter { + main = { + dpi-aware = false; + font = lib.mkForce "JetBrainsMono NF SemiBold:size=14"; + placeholder = " Search..."; + icons-enabled = true; + use-bold = true; + fields = lib.mkForce "name,generic,comment,categories,filename,keywords,exec"; + terminal = "kitty"; + prompt = ""; + show-actions = false; + anchor = "center"; + x-margin = 15; + y-margin = 0; + lines = 10; + width = 50; + horizontal-pad = 20; + vertical-pad = 20; + inner-pad = 5; + line-height = 30; + letter-spacing = 0; + image-size-ratio = 0.2; + exit-on-keyboard-focus-loss = true; + }; + border = { + radius = 5; + width = 2; + }; + dmenu = { + mode = "text"; + }; + colors = { + prompt = lib.mkForce "${config.lib.stylix.colors.base00-hex}ff"; + }; + }; +} diff --git a/modules/hypr/hyprland_desktop.nix b/modules/hypr/default.nix similarity index 94% rename from modules/hypr/hyprland_desktop.nix rename to modules/hypr/default.nix index 1e7c827..565e096 100644 --- a/modules/hypr/hyprland_desktop.nix +++ b/modules/hypr/default.nix @@ -1,6 +1,10 @@ {pkgs, ...}: { + services.hyprpolkitagent.enable = true; + wayland.windowManager.hyprland.enable = true; + wayland.windowManager.hyprland.package = null; + wayland.windowManager.hyprland.portalPackage = null; wayland.windowManager.hyprland.extraConfig = '' autogenerated = 0 # remove this line to remove the warning @@ -14,7 +18,7 @@ monitor = DP-1, highres@highrr, 0x0, 1 exec-once = hyprctl dispatch workspace 1 #exec-once = linux-wallpaperengine --screen-root HDMI-A-1 --silent --fps 60 3000562427 exec-once = hyprlock -exec-once = ashell +exec-once = waybar exec-once = pw-metadata -n settings 0 clock.force-quantum 2048 # exec-once = ashell exec-once = systemctl --user start hyprpolkitagent @@ -27,9 +31,10 @@ exec-once = sunshine debug:full_cm_proto=true # Set programs that you use -$terminal = kitty +$terminal = kitty nu $fileManager = thunar -$menu = rofi -show drun +$menu = fuzzel +$bar = waybar # Some default env vars. env = XCURSOR_SIZE,24 @@ -75,7 +80,7 @@ windowrulev2 = immediate, class:^(cs2)$ decoration { # See https://wiki.hyprland.org/Configuring/Variables/ for more - rounding = 0 + rounding = 5 blur { enabled = yes @@ -139,7 +144,7 @@ misc { # Window Rules - +windowrule = float, class:^(Wiremix)$ # See https://wiki.hyprland.org/Configuring/Keywords/ for more $mainMod = SUPER diff --git a/modules/hypr/hyprland_laptop.nix b/modules/hypr/hyprland_laptop.nix index 8f0eeda..4525375 100644 --- a/modules/hypr/hyprland_laptop.nix +++ b/modules/hypr/hyprland_laptop.nix @@ -1,6 +1,7 @@ {pkgs, ...}: { + services.hyprpolkitagent.enable wayland.windowManager.hyprland.extraConfig = '' autogenerated = 0 # remove this line to remove the warning @@ -27,7 +28,7 @@ exec-once = systemctl --user start hyprpolkitagent # Set programs that you use $terminal = kitty $fileManager = thunar -$menu = rofi -show drun +$menu = fuzzel # Some default env vars. env = XCURSOR_SIZE,24 diff --git a/modules/nushell/default.nix b/modules/nushell/default.nix new file mode 100644 index 0000000..0d5bdfb --- /dev/null +++ b/modules/nushell/default.nix @@ -0,0 +1,16 @@ +{pkgs, config, ...}: + +{ + programs.nushell = { + enable = true; + extraConfig = '' + $env.config.show_banner = false + ''; + }; + # Fish like Autocomplete + + programs.carapace = { + enable = true; + enableNushellIntegration = true; + }; +} diff --git a/modules/nvim/config.nix b/modules/nvim/config.nix new file mode 100644 index 0000000..0dc356d --- /dev/null +++ b/modules/nvim/config.nix @@ -0,0 +1,6 @@ +{ + programs.nixvim.opts = { + shiftwidth = 2; + tabstop = 2; + }; +} diff --git a/modules/nvim/default.nix b/modules/nvim/default.nix index a780dc7..d80204a 100644 --- a/modules/nvim/default.nix +++ b/modules/nvim/default.nix @@ -1,6 +1,7 @@ {config, pkgs, lib, inputs, ...}: { + imports = [ ./config.nix ]; programs.nixvim = { enable = true; plugins.nvim-tree.enable = true; @@ -14,7 +15,15 @@ plugins.web-devicons.enable = true; plugins.which-key.enable = true; plugins.cmp-nvim-lsp.enable = true; + plugins.bufferline.enable = true; + plugins.noice.enable = true; + plugins.mini-pairs.enable = true; + plugins.ts-comments.enable = true; + plugins.snacks.enable = true; + plugins.mini-icons.enable = true; + plugins.nui.enable = true; plugins.telescope.enable = true; plugins.indent-blankline.enable = true; + }; } diff --git a/modules/stylix.nix b/modules/stylix.nix index 95fc112..458dfc5 100644 --- a/modules/stylix.nix +++ b/modules/stylix.nix @@ -20,8 +20,8 @@ };*/ stylix.image = pkgs.fetchurl { - url = "https://w.wallhaven.cc/full/5g/wallhaven-5g22q5.png"; - hash = "sha256-snqkeQecU0opsBfIrnkl6aiV71hSCmqnZBAsibNG4w8="; + url = "https://gitea.base.jeditemple.com/joshuaelm/Wallpapers/raw/branch/main/schemes/nord/wallhaven-731kr3_3840x2160.png"; + hash = "sha256-DHEib1bgtOvNp+wo3+L5PiEbKfZkHgR3vhs4YIouKes="; }; } diff --git a/modules/waybar/waybar.nix b/modules/waybar/waybar.nix index 3d16a0a..653f5d7 100644 --- a/modules/waybar/waybar.nix +++ b/modules/waybar/waybar.nix @@ -1,120 +1,222 @@ -{pkgs, lib,...}: +{ pkgs, lib, ... }: { programs.waybar.enable = true; + programs.waybar.settings = [ -{ - layer = "top"; - position = "top"; - #margin = "5, 5, 5, 5"; - modules-left = [ "hyprland/workspaces"]; - modules-center = [ "mpris" ]; - modules-right = [ "cava" "clock" "network" "pulseaudio/slider" "tray" ]; + { + layer = "top"; + position = "top"; + spacing = 0; + height = 26; - cava = { - bars = 14; - bar_delimiter = 0; - format-icons = ["▁" "▂" "▃" "▄" "▅" "▆" "▇" "█"]; - }; + "modules-left" = [ "hyprland/workspaces" ]; + "modules-center" = [ "mpris" ]; + "modules-right" = [ + "group/tray-expander" + "cava" + "clock" + "bluetooth" + "network" + "pulseaudio" + "cpu" + "battery" + ]; - network = { - format = "󱎔"; - format-disconnected = ""; - format-wifi = "({signalStrength}%) "; - }; + "hyprland/workspaces" = { + "on-click" = "activate"; + format = "{icon}"; + "format-icons" = { + default = ""; + active = "󱓻"; + }; + }; - mpris = { - format = "{dynamic}"; - dynamic-order = ["title" "album" "artist" "position" "length"]; - }; + cpu = { + interval = 5; + format = "󰍛"; + "on-click" = "kitty -e btop"; + }; - tray = { - spacing = 2; - }; + clock = { + format = "{:L%A %H:%M}"; + "format-alt" = "{:L%d %B W%V %Y}"; + tooltip = false; + "on-click-right" = "omarchy-launch-floating-terminal-with-presentation omarchy-tz-select"; + }; - "hyprland/workspaces" = { - active-only = false; - format = "{icon}"; - format-icons = { - active = ""; - default = ""; - }; - }; + network = { + "format-icons" = [ "󰤯" "󰤟" "󰤢" "󰤥" "󰤨" ]; + format = "{icon}"; + "format-wifi" = "{icon}"; + "format-ethernet" = "󰀂"; + "format-disconnected" = "󰤮"; + "tooltip-format-wifi" = "{essid} ({frequency} GHz)\n⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}"; + "tooltip-format-ethernet" = "⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}"; + "tooltip-format-disconnected" = "Disconnected"; + interval = 3; + spacing = 1; + "on-click" = "omarchy-launch-wifi"; + }; -} + battery = { + format = "{capacity}% {icon}"; + "format-discharging" = "{icon}"; + "format-charging" = "{icon}"; + "format-plugged" = ""; + "format-icons" = { + charging = [ "󰢜" "󰂆" "󰂇" "󰂈" "󰢝" "󰂉" "󰢞" "󰂊" "󰂋" "󰂅" ]; + default = [ "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹" ]; + }; + "format-full" = "󰂅"; + "tooltip-format-discharging" = "{power:>1.0f}W↓ {capacity}%"; + "tooltip-format-charging" = "{power:>1.0f}W↑ {capacity}%"; + interval = 5; + "on-click" = "omarchy-menu power"; + states = { + warning = 20; + critical = 10; + }; + }; + + bluetooth = { + format = ""; + "format-disabled"= "󰂲"; + "format-connected"= ""; + "tooltip-format" = "Devices connected: {num_connections}"; + "on-click" = "blueberry"; + }; + + pulseaudio = { + format = "{icon}"; + "on-click" = "kitty --class=Wiremix -e wiremix"; + "on-click-right" = "pamixer -t"; + "tooltip-format" = "Playing at {volume}%"; + "scroll-step" = 5; + "format-muted" = ""; + "format-icons" = { + default = [ "" "" "" ]; + }; + }; + + mpris = { + format = "{dynamic}"; + dynamic-order = ["title" "album" "artist" "position" "length"]; + }; + + cava = { + bars = 14; + bar_delimiter = 0; + format-icons = ["▁" "▂" "▃" "▄" "▅" "▆" "▇" "█"]; + }; + + "group/tray-expander" = { + orientation = "inherit"; + drawer = { + "transition-duration" = 600; + "children-class" = "tray-group-item"; + }; + modules = [ "custom/expand-icon" "tray" ]; + }; + + "custom/expand-icon" = { + format = ""; + tooltip = false; + }; + + tray = { + "icon-size" = 12; + spacing = 17; + }; + } ]; programs.waybar.style = lib.mkAfter '' * { - font-family: "Roboto"; - font-size: 17px; - border-radius: 0px; + border: none; + border-radius: 0; + min-height: 0; + font-family: 'CaskaydiaMono Nerd Font'; + font-size: 12px; } - window#waybar { - margin: 0 0px; - } - - #network { - padding-left: 4px; - padding-right: 2px; - } - - #tray { - margin-right: 5px; - margin-left: 5px; - } - - #cava { - margin-left: 5px; - } - - #mpris { - padding: 0 5px; - margin-left: 5px; - margin-right: 5px; - } - - /*.modules-left { - background: @base02; - box-shadow: 0px 0px 5px 0px #101010; - } - - .modules-center { - background: @base02; - box-shadow: 0px 0px 5px 0px #101010; + .modules-left { + margin-left: 8px; } .modules-right { - background: @base02; - box-shadow: 0px 0px 5px 0px #101010; - }*/ - - - window > box { - background-color: transparent; - margin-top: 5px; - margin-bottom: 5px; - margin-left: 5px; - margin-right: 5px; + margin-right: 8px; } - #pulseaudio-slider slider { - min-height: 0px; - min-width: 0px; - border-radius: 10px; - + #workspaces button { + all: initial; + padding: 0 6px; + margin: 0 1.5px; + min-width: 9px; } - #pulseaudio-slider trough { - min-width: 60px; - border-radius: 10px; - background-color: @base0D; + #workspaces button.empty { + opacity: 0.5; + } + + .modules-left #workspaces button.active { + border-bottom: 0px solid @base05; + } + + .modules-left #workspaces button { + border-bottom: 0px solid @base05; } - #pulseaudio-slider highlight { - background-color: @base0C; - border-radius: 10px; + #cpu, + #battery, + #pulseaudio, + #custom-omarchy, + #custom-screenrecording-indicator, + #custom-update { + min-width: 12px; + margin: 0 7.5px; + } + + #tray { + margin-right: 16px; + } + + #bluetooth { + margin-right: 17px; + } + + #network { + margin-right: 13px; + } + + #custom-expand-icon { + margin-right: 20px; + } + + tooltip { + padding: 2px; + } + + #custom-update { + font-size: 10px; + } + + #clock { + margin-left: 8.75px; + } + + .hidden { + opacity: 0; + } + + #custom-screenrecording-indicator { + min-width: 12px; + margin-left: 8.75px; + font-size: 10px; + } + + #custom-screenrecording-indicator.active { + color: #a55555; } ''; } diff --git a/modules/zen/default.nix b/modules/zen/default.nix index 7393ca4..e138b9e 100644 --- a/modules/zen/default.nix +++ b/modules/zen/default.nix @@ -35,6 +35,7 @@ ExtensionSettings = mkExtensionSettings { "uBlock0@raymondhill.net" = "ublock-origin"; "search@kagi.com" = "kagi-search-for-firefox"; + #"adnauseam@rednoise.org" = "adnauseam"; "{446900e4-71c2-419f-a6a7-df9c091e268b}" = "bitwarden-password-manager"; }; DisableTelemetry = true; diff --git a/patches/bigscreen_1.patch b/patches/bigscreen_1.patch new file mode 100644 index 0000000..4c9a845 --- /dev/null +++ b/patches/bigscreen_1.patch @@ -0,0 +1,234 @@ +From f8b7d3bad1225150c8909df309f8d10c365fdf3b Mon Sep 17 00:00:00 2001 +From: Yaroslav Bolyukin +Date: Sun, 30 Oct 2022 18:59:15 +0100 +Subject: [PATCH 1/2] drm/edid: parse DRM VESA dsc bpp target + +As per DisplayID v2.0 Errata E9 spec "DSC pass-through timing support" +VESA vendor-specific data block may contain target DSC bits per pixel +fields + +Signed-off-by: Yaroslav Bolyukin +Signed-off-by: Lach +--- + drivers/gpu/drm/drm_displayid_internal.h | 8 ++++ + drivers/gpu/drm/drm_edid.c | 61 ++++++++++++++++-------- + include/drm/drm_connector.h | 6 +++ + include/drm/drm_modes.h | 10 ++++ + 4 files changed, 64 insertions(+), 21 deletions(-) + +diff --git a/drivers/gpu/drm/drm_displayid_internal.h b/drivers/gpu/drm/drm_displayid_internal.h +index 957dd0619f5c..d008a98994bb 100644 +--- a/drivers/gpu/drm/drm_displayid_internal.h ++++ b/drivers/gpu/drm/drm_displayid_internal.h +@@ -97,6 +97,10 @@ struct displayid_header { + u8 ext_count; + } __packed; + ++#define DISPLAYID_BLOCK_REV GENMASK(2, 0) ++#define DISPLAYID_BLOCK_PASSTHROUGH_TIMINGS_SUPPORT BIT(3) ++#define DISPLAYID_BLOCK_DESCRIPTOR_PAYLOAD_BYTES GENMASK(6, 4) ++ + struct displayid_block { + u8 tag; + u8 rev; +@@ -144,12 +148,16 @@ struct displayid_formula_timing_block { + + #define DISPLAYID_VESA_MSO_OVERLAP GENMASK(3, 0) + #define DISPLAYID_VESA_MSO_MODE GENMASK(6, 5) ++#define DISPLAYID_VESA_DSC_BPP_INT GENMASK(5, 0) ++#define DISPLAYID_VESA_DSC_BPP_FRACT GENMASK(3, 0) + + struct displayid_vesa_vendor_specific_block { + struct displayid_block base; + u8 oui[3]; + u8 data_structure_type; + u8 mso; ++ u8 dsc_bpp_int; ++ u8 dsc_bpp_fract; + } __packed; + + /* +diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c +index e2e85345aa9a..6e42e55b41f9 100644 +--- a/drivers/gpu/drm/drm_edid.c ++++ b/drivers/gpu/drm/drm_edid.c +@@ -6524,8 +6524,8 @@ static void drm_get_monitor_range(struct drm_connector *connector, + info->monitor_range.min_vfreq, info->monitor_range.max_vfreq); + } + +-static void drm_parse_vesa_mso_data(struct drm_connector *connector, +- const struct displayid_block *block) ++static void drm_parse_vesa_specific_block(struct drm_connector *connector, ++ const struct displayid_block *block) + { + struct displayid_vesa_vendor_specific_block *vesa = + (struct displayid_vesa_vendor_specific_block *)block; +@@ -6541,7 +6541,7 @@ static void drm_parse_vesa_mso_data(struct drm_connector *connector, + if (oui(vesa->oui[0], vesa->oui[1], vesa->oui[2]) != VESA_IEEE_OUI) + return; + +- if (sizeof(*vesa) != sizeof(*block) + block->num_bytes) { ++ if (block->num_bytes < 5) { + drm_dbg_kms(connector->dev, + "[CONNECTOR:%d:%s] Unexpected VESA vendor block size\n", + connector->base.id, connector->name); +@@ -6564,28 +6564,40 @@ static void drm_parse_vesa_mso_data(struct drm_connector *connector, + break; + } + +- if (!info->mso_stream_count) { +- info->mso_pixel_overlap = 0; +- return; +- } ++ info->mso_pixel_overlap = 0; + +- info->mso_pixel_overlap = FIELD_GET(DISPLAYID_VESA_MSO_OVERLAP, vesa->mso); +- if (info->mso_pixel_overlap > 8) { +- drm_dbg_kms(connector->dev, +- "[CONNECTOR:%d:%s] Reserved MSO pixel overlap value %u\n", +- connector->base.id, connector->name, +- info->mso_pixel_overlap); +- info->mso_pixel_overlap = 8; ++ if (info->mso_stream_count) { ++ info->mso_pixel_overlap = FIELD_GET(DISPLAYID_VESA_MSO_OVERLAP, vesa->mso); ++ if (info->mso_pixel_overlap > 8) { ++ drm_dbg_kms(connector->dev, ++ "[CONNECTOR:%d:%s] Reserved MSO pixel overlap value %u\n", ++ connector->base.id, connector->name, ++ info->mso_pixel_overlap); ++ info->mso_pixel_overlap = 8; ++ } + } + + drm_dbg_kms(connector->dev, + "[CONNECTOR:%d:%s] MSO stream count %u, pixel overlap %u\n", + connector->base.id, connector->name, + info->mso_stream_count, info->mso_pixel_overlap); ++ ++ if (block->num_bytes < 7) { ++ /* DSC bpp is optional */ ++ return; ++ } ++ ++ info->dp_dsc_bpp = FIELD_GET(DISPLAYID_VESA_DSC_BPP_INT, vesa->dsc_bpp_int) << 4 | ++ FIELD_GET(DISPLAYID_VESA_DSC_BPP_FRACT, vesa->dsc_bpp_fract); ++ ++ drm_dbg_kms(connector->dev, ++ "[CONNECTOR:%d:%s] DSC bits per pixel %u\n", ++ connector->base.id, connector->name, ++ info->dp_dsc_bpp); + } + +-static void drm_update_mso(struct drm_connector *connector, +- const struct drm_edid *drm_edid) ++static void drm_update_vesa_specific_block(struct drm_connector *connector, ++ const struct drm_edid *drm_edid) + { + const struct displayid_block *block; + struct displayid_iter iter; +@@ -6593,7 +6605,7 @@ static void drm_update_mso(struct drm_connector *connector, + displayid_iter_edid_begin(drm_edid, &iter); + displayid_iter_for_each(block, &iter) { + if (block->tag == DATA_BLOCK_2_VENDOR_SPECIFIC) +- drm_parse_vesa_mso_data(connector, block); ++ drm_parse_vesa_specific_block(connector, block); + } + displayid_iter_end(&iter); + } +@@ -6630,6 +6642,7 @@ static void drm_reset_display_info(struct drm_connector *connector) + info->mso_stream_count = 0; + info->mso_pixel_overlap = 0; + info->max_dsc_bpp = 0; ++ info->dp_dsc_bpp = 0; + + kfree(info->vics); + info->vics = NULL; +@@ -6753,7 +6766,7 @@ static void update_display_info(struct drm_connector *connector, + if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB422) + info->color_formats |= DRM_COLOR_FORMAT_YCBCR422; + +- drm_update_mso(connector, drm_edid); ++ drm_update_vesa_specific_block(connector, drm_edid); + + out: + if (drm_edid_has_internal_quirk(connector, EDID_QUIRK_NON_DESKTOP)) { +@@ -6784,7 +6797,8 @@ static void update_display_info(struct drm_connector *connector, + + static struct drm_display_mode *drm_mode_displayid_detailed(struct drm_device *dev, + const struct displayid_detailed_timings_1 *timings, +- bool type_7) ++ bool type_7, ++ int rev) + { + struct drm_display_mode *mode; + unsigned int pixel_clock = (timings->pixel_clock[0] | +@@ -6805,6 +6819,10 @@ static struct drm_display_mode *drm_mode_displayid_detailed(struct drm_device *d + if (!mode) + return NULL; + ++ if (type_7 && FIELD_GET(DISPLAYID_BLOCK_REV, rev) >= 1) ++ mode->dsc_passthrough_timings_support = ++ !!(rev & DISPLAYID_BLOCK_PASSTHROUGH_TIMINGS_SUPPORT); ++ + /* resolution is kHz for type VII, and 10 kHz for type I */ + mode->clock = type_7 ? pixel_clock : pixel_clock * 10; + mode->hdisplay = hactive; +@@ -6846,7 +6864,7 @@ static int add_displayid_detailed_1_modes(struct drm_connector *connector, + for (i = 0; i < num_timings; i++) { + struct displayid_detailed_timings_1 *timings = &det->timings[i]; + +- newmode = drm_mode_displayid_detailed(connector->dev, timings, type_7); ++ newmode = drm_mode_displayid_detailed(connector->dev, timings, type_7, block->rev); + if (!newmode) + continue; + +@@ -6893,7 +6911,8 @@ static int add_displayid_formula_modes(struct drm_connector *connector, + struct drm_display_mode *newmode; + int num_modes = 0; + bool type_10 = block->tag == DATA_BLOCK_2_TYPE_10_FORMULA_TIMING; +- int timing_size = 6 + ((formula_block->base.rev & 0x70) >> 4); ++ int timing_size = 6 + ++ FIELD_GET(DISPLAYID_BLOCK_DESCRIPTOR_PAYLOAD_BYTES, formula_block->base.rev); + + /* extended blocks are not supported yet */ + if (timing_size != 6) +diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h +index 8f34f4b8183d..01640fcf7464 100644 +--- a/include/drm/drm_connector.h ++++ b/include/drm/drm_connector.h +@@ -837,6 +837,12 @@ struct drm_display_info { + */ + u32 max_dsc_bpp; + ++ /** ++ * @dp_dsc_bpp: DP Display-Stream-Compression (DSC) timing's target ++ * DSC bits per pixel in 6.4 fixed point format. 0 means undefined. ++ */ ++ u16 dp_dsc_bpp; ++ + /** + * @vics: Array of vics_len VICs. Internal to EDID parsing. + */ +diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h +index b9bb92e4b029..312e5c03af9a 100644 +--- a/include/drm/drm_modes.h ++++ b/include/drm/drm_modes.h +@@ -417,6 +417,16 @@ struct drm_display_mode { + */ + enum hdmi_picture_aspect picture_aspect_ratio; + ++ /** ++ * @dsc_passthrough_timing_support: ++ * ++ * Indicates whether this mode timing descriptor is supported ++ * with specific target DSC bits per pixel only. ++ * ++ * VESA vendor-specific data block shall exist with the relevant ++ * DSC bits per pixel declaration when this flag is set to true. ++ */ ++ bool dsc_passthrough_timings_support; + }; + + /** +-- +2.51.0 diff --git a/patches/vesa-dsc-fixed-bpp.patch b/patches/bigscreen_15.patch similarity index 99% rename from patches/vesa-dsc-fixed-bpp.patch rename to patches/bigscreen_15.patch index f0a13dd..6875a96 100644 --- a/patches/vesa-dsc-fixed-bpp.patch +++ b/patches/bigscreen_15.patch @@ -241,4 +241,3 @@ index d4395b92fb85..6c7f589e19ac 100644 apply_edid_quirks(dev, edid_buf, edid_caps); sad_count = drm_edid_to_sad((struct edid *) edid->raw_edid, &sads); - diff --git a/patches/bigscreen_2.patch b/patches/bigscreen_2.patch new file mode 100644 index 0000000..cb6b7e5 --- /dev/null +++ b/patches/bigscreen_2.patch @@ -0,0 +1,46 @@ +From 4374e685d46122ac59ccdd201c3be785e7f3558d Mon Sep 17 00:00:00 2001 +From: Yaroslav Bolyukin +Date: Sun, 30 Oct 2022 19:04:26 +0100 +Subject: [PATCH 2/2] drm/amd: use fixed dsc bits-per-pixel from edid + +VESA vendor header from DisplayID spec may contain fixed bit per pixel +rate, it should be respected by drm driver + +Signed-off-by: Yaroslav Bolyukin +Signed-off-by: Lach +--- + drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +index ef026143dc1c..d068c6db91ce 100644 +--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c ++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +@@ -6430,6 +6430,11 @@ static void fill_stream_properties_from_drm_display_mode( + + stream->output_color_space = get_output_color_space(timing_out, connector_state); + stream->content_type = get_output_content_type(connector_state); ++ ++ /* DisplayID Type VII pass-through timings. */ ++ if (mode_in->dsc_passthrough_timings_support && info->dp_dsc_bpp != 0) { ++ stream->timing.dsc_fixed_bits_per_pixel_x16 = info->dp_dsc_bpp; ++ } + } + + static void fill_audio_info(struct audio_info *audio_info, +@@ -6976,6 +6981,13 @@ create_stream_for_sink(struct drm_connector *connector, + &mode, preferred_mode, scale); + + preferred_refresh = drm_mode_vrefresh(preferred_mode); ++ ++ /* ++ * HACK: In case of multiple supported modes, we should look at the matching mode to decide this flag. ++ * But what is matching mode, how should it be decided? ++ * Assuming that only preferred mode would have this flag. ++ */ ++ mode.dsc_passthrough_timings_support = preferred_mode->dsc_passthrough_timings_support; + } + } + +-- +2.51.0