{
  lib,
  config,
  username,
  ...
}:
let
  cfg = config.atuin;
in
{
  options = {
    atuin = {
      enable = lib.mkEnableOption "Enable atuin in NixOS & home-manager";
    };
  };
  config = lib.mkIf cfg.enable {
    home-manager.users.${username} = {
      programs.atuin = {
        enable = true;
        settings = {
          history_filter = [
            "^btop$"
            "^bash$"
            "^cd$"
            "^clear$"
            "^exit$"
            "^fastfetch$"
            "^kmon$"
            "^l$"
            "^ll$"
            "^pwd$"
            "^up$"
            "^nor$"
            "^ngc$"
            "^rbn$"
          ];
        };
      };
    };
  };
}
