{ ... }:
{
  programs.niri.settings = {
    prefer-no-csd = true;

    cursor = {
      theme = "phinger-cursors-dark";
      size = 16;
      hide-when-typing = true;
      hide-after-inactive-ms = 10000;
    };

    animations.window-open.easing = {
      curve = "linear";
      duration-ms = 230;
    };
    animations.shaders.window-open = builtins.readFile ./shaders/glitch-open.frag;

    layout = {
      gaps = 15;
      focus-ring.enable = false;
      border = {
        enable = true;
        width = 3;
        inactive.gradient = {
          from = "#f69ecf";
          to = "#ff9a56";
          in' = "oklch shorter hue";
          relative-to = "window";
          angle = 135;
        };
        active.gradient = {
          from = "#f69ecf";
          to = "#5bcefa";
          in' = "oklch shorter hue";
          relative-to = "window";
          angle = 135;
        };
      };
      center-focused-column = "never";
      empty-workspace-above-first = false;
      tab-indicator = {
        hide-when-single-tab = true;
        active.color = "#5bcefa";
        inactive.color = "#3c3836";
        gap = 2;
        width = 5;
        corner-radius = 3;
        position = "left";
        gaps-between-tabs = 0;
      };
    };

    window-rules = [
      {
        matches = [
          {
            is-floating = true;
          }
        ];
        baba-is-float = true;
        shadow = {
          offset.y = 0;
          offset.x = 0;
          softness = 40;
          color = "#bab9e5af";
          inactive-color = "#fa9d99af";
          enable = true;
        };
      }
      {
        geometry-corner-radius =
          let
            val = 1.;
          in
          {
            bottom-left = val;
            bottom-right = val;
            top-left = val;
            top-right = val;
          };
        clip-to-geometry = true;
      }
    ];
  };
}
