New to Doom, how to override only part of a package config?

Hi! I’m pretty new to Doom Emacs, and Emacs in general, having only been using it for a couple of weeks. There are times where I would like to customize the configuration of a package, but I’ve been having trouble doing it without having to maintain a whole copy of the original config.el for that package. I must be doing something wrong, but I’m not sure what.

For an easy example, I would like to customize the display of ibuffer. I’m just looking to change the order of some columns, and create additional views to switch out others.

What happened?

I put the following into my personal config.el:

(after! ibuffer
        (setq ibuffer-formats
        ;; Buffer name view
        ((mark modified read-only locked
              " " (size 9 -1 :right)
              " " (mode 16 16 :left :elide)
              " " name)
        ;; File name and process view
        (mark modified read-only locked
              " " (size 9 -1 :right)
              " " (mode 16 16 :left :elide)
              " " filename-and-process)
        ;; minimal view
        (mark modified read-only locked " " name " " filename)))

This kind of works, but the problem is that having this in my private config.el seems to completely override the one in emacs/ibuffer/config.el, and I wound up losing the projectile groups and the human-readable formatting for the size field.

I thought that in order to get it working correctly, I had to copy the whole emacs/ibuffer/config.el code into my private config.el and make the few changes I wanted to the (setq ibuffer-formats...) section. But either I messed something up in the copy process or doing that just doesn’t work, because it started complaining about a variable not being set in the after! block.

What did you expect to happen?

I thought that putting the code to override only the ibuffer-formats section would not wipe out everything else from the ibuffer config.el.

System information

generated  Mar 24, 2024 11:20:30
system     MacOS 13.6.5 Darwin 22.6.0 arm64 mac
emacs      29.1 EMACSDIR=~/.config/emacs/
doom       3.0.0-pre PROFILE=_@0 grafted, HEAD -> master, origin/master, origin/HEAD
           bea8127 2024-03-05 01:21:09 -0500 ~/.config/doom/
shell      /bin/zsh
traits     gui server-running envvar-file
modules    :config use-package :completion company vertico :ui doom doom-dashboard
           hl-todo indent-guides modeline nav-flash ophints (popup +defaults)
           (vc-gutter +pretty) vi-tilde-fringe workspaces :editor (evil +everywhere)
           file-templates fold snippets :emacs dired electric undo vc :term vterm
           :checkers syntax :tools (eval +overlay) lookup magit :os macos :lang
           common-lisp emacs-lisp (graphql +lsp) hy lua markdown org python racket
           (scheme +guile) sh :config (default +bindings +smartparens)
packages   (janet-mode)

I feel like I’m just doing something wrong, but I’m not sure what it is. I’ve tried looking on the Doom Emacs Documentation site, but it seems to be missing a lot of information.

Any information or help is appreciated.