{
  mainUser,
  inputs,
  getFlakePkg',
  # config,
  ...
}:
let
  #   inherit (config) rice;
  niri = (getFlakePkg' inputs.niri "niri-unstable");
  xwayland-satellite = (getFlakePkg' inputs.niri "xwayland-satellite-unstable");
in
{
  imports = [
    inputs.niri.nixosModules.niri
    inputs.niri-tag.nixosModules.niri-tag
  ];
  # user.desktops.niri = {
  #   enable = true;
  # configFile = ./desktop/niri-config.kdl;
  # };
  environment.files."/home/${mainUser}/.config/niri/config.kdl" = {
    uid = 1000;
    gid = 100;
    source = "/home/${mainUser}/.nix/graphical/desktop/niri-config.kdl";
  };
  # user.xdg.config.files."niri/config.kdl".source = ./desktop/niri-config.kdl;
  user.packages = [
    niri
    xwayland-satellite
  ];
  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 = niri;
  };
  services.niri-tag.enable = true;

}

# old hm config, TODO template from this
# {
#       values = {
#         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 = config.rice.borders.gaps;
#           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;
#             }
#           ];
#         xwayland-satellite = {
#           enable = true;
#           path = lib.getExe inputs.niri.packages.${pkgs.system}.xwayland-satellite-unstable;
#         };
#       };
#     }
#
