{
  pkgs,
  mainUser,
  inputs,
  config,
  ...
}:
let
  inherit (config) rice;
in
{
  imports = [
    inputs.niri.nixosModules.niri
    inputs.niri-tag.nixosModules.niri-tag
  ];
  hm.programs.niri.settings = {
    input = {
      warp-mouse-to-focus.enable = true;
    };
    cursor = {
      hide-after-inactive-ms = 5000;
      hide-when-typing = true;
      size = 16;
      theme = rice.cursor.name;
    };
    layout = {
      always-center-single-column = true;
      gaps = 24;
      default-column-width.proportion = 0.5;
      preset-column-widths = map (p: { proportion = p; }) [
        (2.0 / 3.0)
        0.5
        (1.0 / 3.0)
      ];
      focus-ring =
        let
          pal = rice.palette.hex;
        in
        {
          active = {
            color = pal.bright.yellow;
          };
          inactive = {
            color = pal.normal.black;
          };
        };
    };
    prefer-no-csd = true;
    hotkey-overlay.skip-at-startup = true;
    window-rules =
      let
        v = 10.0;
      in
      [
        {
          geometry-corner-radius = {
            bottom-left = v;
            bottom-right = 0.0;
            top-left = 0.0;
            top-right = v;
          };
          clip-to-geometry = true;
        }
      ];
  };

  services.greetd = {
    enable = true;
    restart = false;
    settings =
      let
        session = {
          command = "niri-session";
          user = "${mainUser}";
        };
      in
      {
        default_session = session;
        initial_session = session;
      };
  };
  programs.niri = {
    enable = true;
    package = inputs.niri.packages.${pkgs.system}.niri-unstable;
  };
  services.niri-tag.enable = true;

}
