From a8e522d86ebb754e280cbcfd2eb4b182ce88d2fd Mon Sep 17 00:00:00 2001 From: krizej Date: Tue, 17 Sep 2024 20:01:58 +0200 Subject: [PATCH] zed no rounded corners patch --- .gitignore | 3 ++- files/zed-no-rounded-corners.patch | 23 +++++++++++++++++++++++ hosts/desktop/default.nix | 2 +- hosts/laptop/default.nix | 1 + modules/system.nix | 2 +- pkgs/default.nix | 7 ++++++- 6 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 files/zed-no-rounded-corners.patch diff --git a/.gitignore b/.gitignore index 62c8935..7f993be 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.idea/ \ No newline at end of file +.idea/ +*.swp diff --git a/files/zed-no-rounded-corners.patch b/files/zed-no-rounded-corners.patch new file mode 100644 index 0000000..4c64272 --- /dev/null +++ b/files/zed-no-rounded-corners.patch @@ -0,0 +1,23 @@ +diff --git a/crates/gpui/src/platform/blade/shaders.wgsl b/crates/gpui/src/platform/blade/shaders.wgsl +index c3983c7acc..1a5689e635 100644 +--- a/crates/gpui/src/platform/blade/shaders.wgsl ++++ b/crates/gpui/src/platform/blade/shaders.wgsl +@@ -163,7 +163,7 @@ fn blur_along_x(x: f32, y: f32, sigma: f32, corner: f32, half_size: vec2) - + } + + fn pick_corner_radius(point: vec2, radii: Corners) -> f32 { +- if (point.x < 0.0) { ++ /* if (point.x < 0.0) { + if (point.y < 0.0) { + return radii.top_left; + } else { +@@ -175,7 +175,8 @@ fn pick_corner_radius(point: vec2, radii: Corners) -> f32 { + } else { + return radii.bottom_right; + } +- } ++ } */ ++ return 0.0; + } + + fn quad_sdf(point: vec2, bounds: Bounds, corner_radii: Corners) -> f32 { diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix index df53dbd..a49a0f6 100644 --- a/hosts/desktop/default.nix +++ b/hosts/desktop/default.nix @@ -44,7 +44,7 @@ qbittorrent godot_4 jetbrains.idea-community-bin - inputs.zed.packages.${system}.zed-editor + zed-editor mumble ]; diff --git a/hosts/laptop/default.nix b/hosts/laptop/default.nix index 4f9385d..e7eeeca 100644 --- a/hosts/laptop/default.nix +++ b/hosts/laptop/default.nix @@ -20,6 +20,7 @@ aseprite cloc viu + zed-editor ]; file = { diff --git a/modules/system.nix b/modules/system.nix index ba78ec5..bc2a567 100644 --- a/modules/system.nix +++ b/modules/system.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, config, ...} @ args: let +{ lib, pkgs, config, ... } @ args: let inherit (lib) mkOption types; cfg = config.chuj.system; in { diff --git a/pkgs/default.nix b/pkgs/default.nix index f1eeefc..4dc22da 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: with pkgs; [ +{ inputs, pkgs, ... }: with pkgs; [ (final: prevPkgs: { win7-cursors = callPackage ./win7-cursors.nix {}; sddm-i3-theme = callPackage ./sddm-i3-theme.nix {}; @@ -29,5 +29,10 @@ sha256 = "sha256-t794WEMJx/JNX3gTMHfgquFWB7yXkleW07+QURm1NPM="; }; }); + zed-editor = (inputs.zed.packages.${system}.zed-editor.overrideAttrs { + patches = [ + ../files/zed-no-rounded-corners.patch + ]; + }); }) ]