Skip to content

Commit

Permalink
build: remove nv patches (#3957)
Browse files Browse the repository at this point in the history
  • Loading branch information
vaxerski authored Nov 26, 2023
1 parent ad3f688 commit cd96cee
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 72 deletions.
1 change: 0 additions & 1 deletion .github/workflows/nix-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:
matrix:
package:
- hyprland
- hyprland-nvidia
- xdg-desktop-portal-hyprland

runs-on: ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
hyprland
hyprland-unwrapped
hyprland-debug
hyprland-nvidia
# hyprland-extras
xdg-desktop-portal-hyprland
# dependencies
Expand Down
9 changes: 5 additions & 4 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,22 @@
xcbutilwm,
xwayland,
debug ? false,
enableNvidiaPatches ? false,
enableXWayland ? true,
legacyRenderer ? false,
withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd,
wrapRuntimeDeps ? true,
version ? "git",
commit,
# deprecated flags
enableNvidiaPatches ? false,
nvidiaPatches ? false,
hidpiXWayland ? false,
}:
assert lib.assertMsg (!nvidiaPatches) "The option `nvidiaPatches` has been renamed `enableNvidiaPatches`";
assert lib.assertMsg (!nvidiaPatches) "The option `nvidiaPatches` has been removed.";
assert lib.assertMsg (!enableNvidiaPatches) "The option `enableNvidiaPatches` has been removed.";
assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been removed. Please refer https://wiki.hyprland.org/Configuring/XWayland";
stdenv.mkDerivation {
pname = "hyprland${lib.optionalString enableNvidiaPatches "-nvidia"}${lib.optionalString debug "-debug"}";
pname = "hyprland${lib.optionalString debug "-debug"}";
inherit version;

src = lib.cleanSourceWith {
Expand Down Expand Up @@ -82,7 +83,7 @@ assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been remov
wayland
wayland-protocols
pciutils
(wlroots.override {inherit enableNvidiaPatches;})
wlroots
]
++ lib.optionals enableXWayland [libxcb xcbutilwm xwayland]
++ lib.optionals withSystemd [systemd];
Expand Down
9 changes: 3 additions & 6 deletions nix/hm-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ self: {
cfg = config.wayland.windowManager.hyprland;
defaultHyprlandPackage = self.packages.${pkgs.stdenv.hostPlatform.system}.default.override {
enableXWayland = cfg.xwayland.enable;
inherit (cfg) enableNvidiaPatches;
};
in {
disabledModules = ["services/window-managers/hyprland.nix"];
Expand Down Expand Up @@ -35,12 +34,10 @@ in {
defaultText = lib.literalExpression ''
hyprland.packages.''${pkgs.stdenv.hostPlatform.system}.default.override {
enableXWayland = config.wayland.windowManager.hyprland.xwayland.enable;
inherit (config.wayland.windowManager.hyprland) enableNvidiaPatches;
}
'';
description = lib.mdDoc ''
Hyprland package to use. Will override the 'xwayland' and
'enableNvidiaPatches' options.
Hyprland package to use. Will override the 'xwayland' option.
Defaults to the one provided by the flake. Set it to
{package}`pkgs.hyprland` to use the one provided by nixpkgs or
Expand Down Expand Up @@ -86,8 +83,6 @@ in {

xwayland.enable = lib.mkEnableOption (lib.mdDoc "XWayland") // {default = true;};

enableNvidiaPatches = lib.mkEnableOption (lib.mdDoc "patching wlroots for better Nvidia support.");

extraConfig = lib.mkOption {
type = lib.types.nullOr lib.types.lines;
default = "";
Expand Down Expand Up @@ -173,5 +168,7 @@ in {
imports = [
(lib.mkRemovedOptionModule ["wayland" "windowManager" "hyprland" "xwayland" "hidpi"]
"Support for this option has been removed. Refer to https://wiki.hyprland.org/Configuring/XWayland for more info")
(lib.mkRemovedOptionModule ["wayland" "windowManager" "hyprland" "xwayland" "enableNvidiaPatches"]
"Nvidia patches are no longer needed for Hyprland")
];
}
16 changes: 7 additions & 9 deletions nix/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ in {
readOnly = true;
default = cfg.package.override {
enableXWayland = cfg.xwayland.enable;
enableNvidiaPatches = cfg.enableNvidiaPatches;
};
defaultText =
literalExpression
Expand All @@ -50,12 +49,6 @@ in {
portalPackage = mkPackageOptionMD inputs.xdph.packages.${system} "xdg-desktop-portal-hyprland" {};

xwayland.enable = mkEnableOption (mdDoc "support for XWayland") // {default = true;};

enableNvidiaPatches =
mkEnableOption null
// {
description = mdDoc "Whether to apply patches to wlroots for better Nvidia support.";
};
};

config = mkIf cfg.enable {
Expand Down Expand Up @@ -91,9 +84,14 @@ in {
"XWayland patches are deprecated. Refer to https://wiki.hyprland.org/Configuring/XWayland"
)
(
mkRenamedOptionModule
["programs" "hyprland" "nvidiaPatches"]
mkRemovedOptionModule
["programs" "hyprland" "enableNvidiaPatches"]
"Nvidia patches are no longer needed"
)
(
mkRemovedOptionModule
["programs" "hyprland" "nvidiaPatches"]
"Nvidia patches are no longer needed"
)
];
}
7 changes: 6 additions & 1 deletion nix/overlays.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ in {
};
hyprland-unwrapped = final.hyprland.override {wrapRuntimeDeps = false;};
hyprland-debug = final.hyprland.override {debug = true;};
hyprland-nvidia = final.hyprland.override {enableNvidiaPatches = true;};
hyprland-nvidia =
builtins.trace ''
hyprland-nvidia was removed. Please use the hyprland package.
Nvidia patches are no longer needed.
''
final.hyprland;
hyprland-hidpi =
builtins.trace ''
hyprland-hidpi was removed. Please use the hyprland package.
Expand Down
41 changes: 0 additions & 41 deletions nix/patches/wlroots-nvidia.patch

This file was deleted.

10 changes: 1 addition & 9 deletions nix/wlroots.nix
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
{
lib,
version,
src,
wlroots,
hwdata,
libdisplay-info,
libliftoff,
enableXWayland ? true,
enableNvidiaPatches ? false,
}:
wlroots.overrideAttrs (old: {
inherit version src enableXWayland;

pname = "${old.pname}-hyprland${lib.optionalString enableNvidiaPatches "-nvidia"}";

patches =
(old.patches or [])
++ (lib.optionals enableNvidiaPatches [
./patches/wlroots-nvidia.patch
]);
pname = "${old.pname}-hyprland";

buildInputs = old.buildInputs ++ [hwdata libliftoff libdisplay-info];

Expand Down

0 comments on commit cd96cee

Please sign in to comment.