From 2a660ba5bc445af85406ec6b9fd912135ce07dab Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Mon, 1 Jul 2024 22:26:02 +0530 Subject: [PATCH] add polkit pantheon, enable alsa32bit --- flake.lock | 104 +++++++++++++++++------------------ home-manager/xdg.nix | 1 + modules-overlays/default.nix | 2 +- pkgs/user-packages.nix | 2 +- system/hardware/audio.nix | 2 +- system/hardware/graphics.nix | 39 +++++++------ system/hyprland.nix | 23 +++----- 7 files changed, 85 insertions(+), 88 deletions(-) diff --git a/flake.lock b/flake.lock index c9d78758..db1dd88a 100644 --- a/flake.lock +++ b/flake.lock @@ -34,11 +34,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1718887932, - "narHash": "sha256-eo1B6mUPNlRMCe9dgt1bzXinUlD+cD1DdVFj1fxwZnU=", + "lastModified": 1719676503, + "narHash": "sha256-5ER4843mn9Am8FKsUovaPFzwBIc2LOFvmcd+iUr8P9g=", "owner": "koverstreet", "repo": "bcachefs-tools", - "rev": "411df4e53fdc58cfca2e473e54c1bed9cf17740d", + "rev": "755788e2d6065ac35e680a23c48125a5cd63f7b7", "type": "github" }, "original": { @@ -110,11 +110,11 @@ "yafas": "yafas" }, "locked": { - "lastModified": 1719505223, - "narHash": "sha256-7DGqcG5tespj/+5lYl7weWJwsvFjmFNcsWZaO9GDjP8=", + "lastModified": 1719992991, + "narHash": "sha256-X1WYxzXRB/KbYLML90AtMTE0mpLHtAe6avSDBh203bs=", "owner": "chaotic-cx", "repo": "nyx", - "rev": "71a44f1448c037dbd9ef5df4eaedeb699499c506", + "rev": "378c12fede02f2cbdb14508af603cbefa334bcac", "type": "github" }, "original": { @@ -189,11 +189,11 @@ "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1719323427, - "narHash": "sha256-f4ppP2MBPJzkuy/q+PIfyyTWX9OzqgPV1XSphX71tdA=", + "lastModified": 1720092796, + "narHash": "sha256-MOGRXjPMd+dK628hGd0r4Elcl0g6OrDo51D7k6hJfRw=", "owner": "cachix", "repo": "devenv", - "rev": "f810f8d8cb4e674d7e635107510bcbbabaa755a3", + "rev": "1dac8dc400358738ceaf84f6be800e9a9b66bc33", "type": "github" }, "original": { @@ -390,11 +390,11 @@ ] }, "locked": { - "lastModified": 1717285511, - "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", + "lastModified": 1719994518, + "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", + "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", "type": "github" }, "original": { @@ -580,11 +580,11 @@ ] }, "locked": { - "lastModified": 1719438532, - "narHash": "sha256-/Vmso2ZMoFE3M7d1MRsQ2K5sR8CVKnrM6t1ys9Xjpz4=", + "lastModified": 1719677234, + "narHash": "sha256-qO9WZsj/0E6zcK4Ht1y/iJ8XfwbBzq7xdqhBh44OP/M=", "owner": "nix-community", "repo": "home-manager", - "rev": "1a4f12ae0bda877ec4099b429cf439aad897d7e9", + "rev": "36317d4d38887f7629876b0e43c8d9593c5cc48d", "type": "github" }, "original": { @@ -600,11 +600,11 @@ ] }, "locked": { - "lastModified": 1719438532, - "narHash": "sha256-/Vmso2ZMoFE3M7d1MRsQ2K5sR8CVKnrM6t1ys9Xjpz4=", + "lastModified": 1720045378, + "narHash": "sha256-lmE7B+QXw7lWdBu5GQlUABSpzPk3YBb9VbV+IYK5djk=", "owner": "nix-community", "repo": "home-manager", - "rev": "1a4f12ae0bda877ec4099b429cf439aad897d7e9", + "rev": "0a30138c694ab3b048ac300794c2eb599dc40266", "type": "github" }, "original": { @@ -700,11 +700,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1719526850, - "narHash": "sha256-GPqjH+P9PPmln5KQbyCKm3kfL1NCykIPLejhUel//w4=", + "lastModified": 1720092067, + "narHash": "sha256-ebMlTz4wm+Md5BkCk6uGcRUvOvyjtc4bENvVSO5jrBI=", "ref": "refs/heads/main", - "rev": "b7f42a1e88a5b6c9d2dbdba31e0f35f6a02461e7", - "revCount": 4893, + "rev": "0a6e83005f1910b5c1ec78476fcffc05af47833a", + "revCount": 4906, "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" @@ -997,11 +997,11 @@ ] }, "locked": { - "lastModified": 1719380852, - "narHash": "sha256-Li7zNOomyu0FVtm3TyyeUUCZex6L8QpGAJtiFQKGZGw=", + "lastModified": 1719631702, + "narHash": "sha256-HMWxIehVO8pHp7OlqBYliiLOds34UJHSRn5FPdEb1j8=", "owner": "Jovian-Experiments", "repo": "Jovian-NixOS", - "rev": "fd232b7d5d328619b21b867199b31ce799ae29f3", + "rev": "2f9668e19aff06550cd154c87c0af120735a56a4", "type": "github" }, "original": { @@ -1025,11 +1025,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1718782018, - "narHash": "sha256-8SBmf7Sx5xMLzL4VGEU0fe8cuq0yMumdkXgOPXXD3Bo=", + "lastModified": 1719818887, + "narHash": "sha256-Bogl1pJlgby7OpR16jp8zwOWV7FHRxCsnNxHcisyIq0=", "owner": "nix-community", "repo": "lanzaboote", - "rev": "6fa7bc0522f71d3906a3788bbd80c344cd9c4523", + "rev": "0e6457c98547ec8866714d4222545e7e8c1ae429", "type": "github" }, "original": { @@ -1158,11 +1158,11 @@ ] }, "locked": { - "lastModified": 1719537947, - "narHash": "sha256-9J85rLXEnuX68Y6VzzlrkMAPmvRvjii5aHyMz5Jfq0Q=", + "lastModified": 1720056415, + "narHash": "sha256-mWXA7NiS9EbIRefc1kFbCC6r/hHhn5yYP8CEMg/T1Q0=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "b9212133b8b517f99d7cf217823ff43d0432b720", + "rev": "4dd84dc0426c8c1ef319d7c3c4f64278f25a45c3", "type": "github" }, "original": { @@ -1200,11 +1200,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1719254875, - "narHash": "sha256-ECni+IkwXjusHsm9Sexdtq8weAq/yUyt1TWIemXt3Ko=", + "lastModified": 1719848872, + "narHash": "sha256-H3+EC5cYuq+gQW8y0lSrrDZfH71LB4DAf+TDFyvwCNA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2893f56de08021cffd9b6b6dfc70fd9ccd51eb60", + "rev": "00d80d13810dbfea8ab4ed1009b09100cca86ba8", "type": "github" }, "original": { @@ -1216,11 +1216,11 @@ }, "nixpkgs-edge": { "locked": { - "lastModified": 1719555723, - "narHash": "sha256-e4t7AmgF40lPcTqaH0pbZ9++ueBZkqNmW6HAKYfZL8o=", + "lastModified": 1720099764, + "narHash": "sha256-6pgncwV9mRNkF1hSbUAYnj3ZZgbzr5xptUxqF4Cy/x4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "052a39dfa402d5935089338759d7130045dc9625", + "rev": "39c6a3776210b2b19a2e4c35040d63786e7178e6", "type": "github" }, "original": { @@ -1327,11 +1327,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1719254875, - "narHash": "sha256-ECni+IkwXjusHsm9Sexdtq8weAq/yUyt1TWIemXt3Ko=", + "lastModified": 1719848872, + "narHash": "sha256-H3+EC5cYuq+gQW8y0lSrrDZfH71LB4DAf+TDFyvwCNA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2893f56de08021cffd9b6b6dfc70fd9ccd51eb60", + "rev": "00d80d13810dbfea8ab4ed1009b09100cca86ba8", "type": "github" }, "original": { @@ -1342,11 +1342,11 @@ }, "nur": { "locked": { - "lastModified": 1719554817, - "narHash": "sha256-LdDYnd2PfcMy/yZKVJ7ujkLA7f/hKM+jSVXxrCAecfs=", + "lastModified": 1720089983, + "narHash": "sha256-myMQWXP39p0c7saIADxTzcSugO2kymmGWQ1p/lGaZ7Y=", "owner": "nix-community", "repo": "NUR", - "rev": "7c4abedf3993f6e2b9862144c2c6311ab035c6ed", + "rev": "b278b41e760f20c537edb57284ee4bbc5a674bf0", "type": "github" }, "original": { @@ -1470,11 +1470,11 @@ "systems": "systems_15" }, "locked": { - "lastModified": 1719389873, - "narHash": "sha256-e7EKgHgu+XscGqfv06w/Cgt6//oyXq3GgftpQQhpFUY=", + "lastModified": 1720046114, + "narHash": "sha256-FKfCg05QlHCOoJdWDFC9lsk19VS4GiVah8jIxDsDl90=", "owner": "hyprland-community", "repo": "pyprland", - "rev": "93f03774eecdebf3a019ade06548ad03d0ff4cd1", + "rev": "294f8424e4fd8c0981010547d3f0a4ba90c75f95", "type": "github" }, "original": { @@ -1911,11 +1911,11 @@ ] }, "locked": { - "lastModified": 1719212309, - "narHash": "sha256-ErkTgm4qDtSRNRijBMwxcPsefrhTkIczGg7RaxoUy8g=", + "lastModified": 1719988875, + "narHash": "sha256-CGbGKSnby5YY3qOsWEXdvTWl5W4T8jUrCvbHmEHHQgE=", "owner": "Alexays", "repo": "Waybar", - "rev": "ccc3c132124623bde5127937fe4fc9aa45a9d35d", + "rev": "6f994c849d6ee36ae3e24dd17c7cef1a7f288e94", "type": "github" }, "original": { @@ -1964,11 +1964,11 @@ "systems": "systems_18" }, "locked": { - "lastModified": 1718619174, - "narHash": "sha256-FWW68AVYmB91ZDQnhLMBNCUUTCjb1ZpO2k2KIytHtkA=", + "lastModified": 1719942321, + "narHash": "sha256-Mb6EdUtgujTNTY6oRLxM/ZCyWUrk+p3V6XcJZ1hSUe4=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "c7894aa54f9a7dbd16df5cd24d420c8af22d5623", + "rev": "c5b30938710d6c599f3f5cd99a3ffac35381fb0f", "type": "github" }, "original": { diff --git a/home-manager/xdg.nix b/home-manager/xdg.nix index 5fe49033..246b150d 100644 --- a/home-manager/xdg.nix +++ b/home-manager/xdg.nix @@ -63,5 +63,6 @@ in { # PDF "application/pdf" = "org.gnome.Evince.desktop;google-chrome-beta.desktop;"; + "text/html" = "google-chrome-beta.desktop;org.gnome.TextEditor.desktop;"; }; } diff --git a/modules-overlays/default.nix b/modules-overlays/default.nix index ffe0c749..de6db3e2 100644 --- a/modules-overlays/default.nix +++ b/modules-overlays/default.nix @@ -10,7 +10,7 @@ nixpkgs.overlays = [ (final: prev: { - # bcachefs-tools = inputs.bcachefs-tools.packages.${pkgs.system}.bcachefs-tools; + bcachefs-tools = inputs.bcachefs-tools.packages.${pkgs.system}.bcachefs-tools; }) ]; } diff --git a/pkgs/user-packages.nix b/pkgs/user-packages.nix index ad1b3108..4ad6979b 100644 --- a/pkgs/user-packages.nix +++ b/pkgs/user-packages.nix @@ -85,6 +85,7 @@ # emacs # IDEs # + android-studio-full (jetbrains.plugins.addPlugins jetbrains.phpstorm [ "github-copilot" "nixidea" @@ -106,7 +107,6 @@ # list of latest packages from nixpkgs master # Can be used to install latest version of some packages # Some packages may not be cached so.. it may take some time to build - android-studio-full ]); services.flatpak.packages = [ diff --git a/system/hardware/audio.nix b/system/hardware/audio.nix index 5dece875..e09d0fc9 100644 --- a/system/hardware/audio.nix +++ b/system/hardware/audio.nix @@ -5,7 +5,7 @@ services.pipewire = { enable = true; alsa.enable = true; # alsa support - # alsa.support32Bit = true; + alsa.support32Bit = true; pulse.enable = true; # pulseaudio compat jack.enable = true; # enable jack audio }; diff --git a/system/hardware/graphics.nix b/system/hardware/graphics.nix index 5008c206..7766c95c 100644 --- a/system/hardware/graphics.nix +++ b/system/hardware/graphics.nix @@ -7,6 +7,27 @@ }: let nur-amdgpu = config.nur.repos.materus; in { + hardware.amdgpu = { + initrd.enable = true; + legacySupport.enable = true; + # disabled to use a mix of pocl and rocm below + opencl.enable = false; + }; + + hardware.amdgpu.amdvlk = { + enable = true; + support32Bit.enable = true; + supportExperimental.enable = true; + settings = { + AllowVkPipelineCachingToDisk = 1; + ShaderCacheMode = 1; + IFH = 0; + EnableVmAlwaysValid = 1; + IdleAfterSubmitGpuMask = 0; + }; + }; + + # AMDGPU-PRO firmware hardware.firmware = with nur-amdgpu; [ amdgpu-pro-libs.firmware.vcn amdgpu-pro-libs.firmware @@ -19,6 +40,7 @@ in { # Extra drivers extraPackages = (with pkgs; [ + # LIBVA and VDPAU are hardware acceleration drivers libva-vdpau-driver libvdpau-va-gl libva @@ -46,23 +68,6 @@ in { vulkan-tools # vulkan graphics library tools ]; - hardware.amdgpu.initrd.enable = true; - hardware.amdgpu.legacySupport.enable = true; - hardware.amdgpu.opencl.enable = false; - - hardware.amdgpu.amdvlk = { - enable = true; - support32Bit.enable = true; - supportExperimental.enable = true; - settings = { - AllowVkPipelineCachingToDisk = 1; - ShaderCacheMode = 1; - IFH = 0; - EnableVmAlwaysValid = 1; - IdleAfterSubmitGpuMask = 0; - }; - }; - # Use modesetting driver for Xorg, its better and updated # AMDGPU graphics driver for Xorg is deprecated services.xserver.videoDrivers = ["modesetting"]; diff --git a/system/hyprland.nix b/system/hyprland.nix index 778d4cf7..e86a8710 100644 --- a/system/hyprland.nix +++ b/system/hyprland.nix @@ -115,7 +115,6 @@ in { pamixer pavucontrol # audio control playerctl # media player control - polkit_gnome # needed for apps requesting root access # pywal # for automatic color schemes from wallpaper rofi-wayland slurp # screenshots @@ -188,20 +187,12 @@ in { # Run XDG autostart, this is needed for a DE-less setup like Hyprland services.xserver.desktopManager.runXdgAutostartIfNone = true; - systemd = { - # Polkit starting systemd service - needed for apps requesting root access - user.services.polkit-gnome-authentication-agent-1 = { - description = "polkit-gnome-authentication-agent-1"; - wantedBy = ["graphical-session.target"]; - wants = ["graphical-session.target"]; - after = ["graphical-session.target"]; - serviceConfig = { - Type = "simple"; - ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; - Restart = "on-failure"; - RestartSec = 1; - TimeoutStopSec = 10; - }; - }; + systemd.user.services."pantheon-polkit-agent" = { + description = "Pantheon Polkit Agent"; + wantedBy = [ "graphical-session.target" ]; + upheldBy = [ "graphical-session.target" ]; + partOf = [ "graphical-session.target" ]; + script = "${pkgs.pantheon.pantheon-agent-polkit}/libexec/policykit-1-pantheon/io.elementary.desktop.agent-polkit"; }; + }