Manjaro setup - Configuration as Code

Hello all,

I’ve only been using Manjaro for around 9 months. Coming from a FreeBSD background, my head went to wanting ZFS-on-root (mirrored SSDs) with automated snapshotting, boot environments, yadda yadda yadda. But coming up to a year on, I realise that because ZFS isn’t as baked in I really don’t reap some of the same benefits as I do in FreeBSD…

So, I’ve got myself a shiny new nvme drive, and figured I’d do a reinstall. But because I won’t be snapshotting/mirroring my root disk in the same way, I thought I’d like to capture the configuration of the system in code - that way the OS becomes a fairly standard/documented install, and then I just run my config as code tool to set everything up as it should be - my data will reside on a ZFS pool and backed up separately, but I’d like the system to be as “disposable” as possible.

So now comes my questions:

  1. How do I go about collecting the configuration I’ve already done over the past 9 months?
    • I think the only stuff in /etc I’ve touched is around network configuration
    • Configuration in my home directory I’m not worried about yet - that’ll be in a zpool with snapshots and backups
    • How can I get a list of package that I’ve installed? I’m not interested in capturing “base” packages that come with Manjaro, or dependencies. Just stuff I’ve installed.
      • Probably worth noting here that I’m on stable, and use yay to install packages from wherever they come from - Manjaro, Arch, community, AUR…As you can probably tell I generally don’t pay attention to where packages are coming from.
  2. What tooling would people here recommend?
    • I’ve used quite a lot of Ansible for server configuration
    • Is there something more native to Manjaro/Arch? Or more suited to desktop configuration?
  3. Should I need to reinstall Manjaro in the future, would you recommend selecting a fairly “standard” install, or is there the ability to do a scripted install?
    • Bearing in mind that reinstalls could be months or years apart, a scripted install sounds risky because options could change over time, whereas a documented standard install would let “future me” know “here’s what I did last time, choose something equivalent this time”
    • When it comes to having DKMS modules (e.g. nvidia, ZFS) would you recommend installing them at install time? Or capturing these as part of the configuration as code run after installation?

Thank you for you time and for any advice you might have!

That’s a lot of questions, in… well… one question!

So I’d delete this one and split up your questions and add relevant tags like #zfs #pamac , … to each individual question to attract the relevant experts because now people like me look at your question and go:

Aw, @#$&! I don’t know half of this and then move on to another question they can answer…