{
  config,
  marleylib,
  lib,
  inputs,
  ...
}: let
  cfg = config.marleyos.shell.niri;

  inherit (marleylib.module) enabled;
in {
  options.marleyos.shell.niri.enable = lib.mkEnableOption "niri";

  imports = [inputs.niri-flake.nixosModules.niri];

  config = lib.mkIf cfg.enable {
    nixpkgs.overlays = [inputs.niri-flake.overlays.niri];

    marleyos = {
      shell.hyprlock = enabled;
      programs = {
        waybar = enabled;
      };
      services = {
        gnome-keyring = enabled;
      };
    };

    programs.niri = {
      enable = true;
    };
  };
}
